This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit)
Related to T3079
Paths
| Differential D5194 Authored by ardumont on Mar 3 2021, 6:50 PM.
Details
Summary This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079
Diff Detail
Event TimelineHerald added a reviewer: Reviewers. · View Herald TranscriptMar 3 2021, 6:50 PM2021-03-03 18:50:04 (UTC+1) Comment Actions Build is green Patch application report for D5194 (id=18579)Could not rebase; Attempt merge onto a750b58718... Updating a750b58..9d8e662 Fast-forward MANIFEST.in | 1 + conftest.py | 6 + swh/auth/pytest_plugin.py | 160 ++++++++++++++++++++++++ swh/auth/sample_data.py | 144 +++++++++++++++++++++ swh/auth/tests/conftest.py | 39 ------ swh/auth/tests/sample_data.py | 284 ------------------------------------------ swh/auth/tests/test_auth.py | 86 +++++++------ 7 files changed, 353 insertions(+), 367 deletions(-) create mode 100644 conftest.py create mode 100644 swh/auth/pytest_plugin.py create mode 100644 swh/auth/sample_data.py delete mode 100644 swh/auth/tests/conftest.py delete mode 100644 swh/auth/tests/sample_data.py Changes applied before testcommit 9d8e662302a24a754cbc180d38dfe622a1a42f8f Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth This will be required for module depending on it commit 2d3a37d54c4eff3c1421f2e9b093cf1c6118cdb5 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 17:41:29 2021 +0100 auth: Rework tests logic and add coverage to decode_token endpoint This reworks the tests logic as well to reuse the way web tests are written. This is a first step to actually use the mock class defined here as fixture for future modules which will depend on swh-auth (swh-web-client, swh-web and swh-deposit). Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/5/ for more details. Harbormaster completed remote builds in B19669: Diff 18579.Mar 3 2021, 6:50 PM2021-03-03 18:50:47 (UTC+1) Comment Actions I think you should leave the sample_data module inside the tests folder, create a keycloak_mock.py module (also in tests) containing the Keycloak mocked class and simply declare the keycloak_mock fixture in the pytest_plugin file. Comment Actions
makes more sense than the current proposed diff, thanks Comment Actions
mmm, except we have some hard-coded sample like USER_INFO, OIDC_PROFILE, ... Comment Actions Rework according to review This:
Comment Actions Build is green Patch application report for D5194 (id=18584)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit 16d3e0ae12117e5b4a1e02baedc6781c15b33c57 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/8/ for more details. Harbormaster completed remote builds in B19675: Diff 18584.Mar 4 2021, 10:20 AM2021-03-04 10:20:18 (UTC+1)
ardumont retitled this revision from Expose a pytest plugin for swh.auth to Expose a pytest plugin for swh.auth.keycloak.Mar 4 2021, 10:25 AM2021-03-04 10:25:24 (UTC+1) Comment Actions Update docstring on attributes missing explanation. Fix sphinx typo :py:data: for module attribute [1] [1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#python-roles Comment Actions Build is green Patch application report for D5194 (id=18585)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit e07dab6095ff8c6473201c1994914e69e7af55a4 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/9/ for more details. Harbormaster completed remote builds in B19676: Diff 18585.Mar 4 2021, 10:34 AM2021-03-04 10:34:46 (UTC+1) Comment Actions See inline comment.
This revision now requires changes to proceed.Mar 4 2021, 12:23 PM2021-03-04 12:23:49 (UTC+1)
Comment Actions Adapt according to review/discussion Allow re-definition of oidc_profile, user_info, raw_realm_public_key but let there be a When needed, the mock can be adapted so the decode_token method does the right and Comment Actions Build is green Patch application report for D5194 (id=18601)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit bbd8b85e21ae94275ca678396ca31a4cbd098159 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/10/ for more details. Harbormaster completed remote builds in B19693: Diff 18601.Mar 4 2021, 3:32 PM2021-03-04 15:32:32 (UTC+1) Comment Actions Build is green Patch application report for D5194 (id=18602)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit 13c984d7089c6300d89e16259097f72d5ea738d2 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/11/ for more details. Harbormaster completed remote builds in B19694: Diff 18602.Mar 4 2021, 3:34 PM2021-03-04 15:34:56 (UTC+1) Comment Actions Just a couple of small changes to add and we should be good here.
This revision now requires changes to proceed.Mar 4 2021, 3:44 PM2021-03-04 15:44:13 (UTC+1) ardumont added inline comments.
Comment Actions Adapt according to suggestions:
I did not modify the setters yet. Comment Actions Build is green Patch application report for D5194 (id=18610)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit 31a3a4fc9e25ee823aeb41bd76cdc4957d286ec3 Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/12/ for more details. Harbormaster completed remote builds in B19702: Diff 18610.Mar 4 2021, 5:22 PM2021-03-04 17:22:38 (UTC+1) Comment Actions A small little change and we are good.
This revision now requires changes to proceed.Mar 4 2021, 5:26 PM2021-03-04 17:26:53 (UTC+1)
Comment Actions Adapt according to last and way better implementation suggestion about the check Comment Actions Build is green Patch application report for D5194 (id=18611)Rebasing onto d2f211feb9... Current branch diff-target is up to date. Changes applied before testcommit 63b28edb1f40ddcfe16859156ee5c61ad9bc834b Author: Antoine R. Dumont (@ardumont) <antoine.romain.dumont@gmail.com> Date: Wed Mar 3 18:47:31 2021 +0100 Expose a pytest plugin for swh.auth.keycloak This will be required for modules depending on it (swh.web, swh.web.client, swh.deposit) Related to T3079 See https://jenkins.softwareheritage.org/job/DAUTH/job/tests-on-diff/13/ for more details. Harbormaster completed remote builds in B19703: Diff 18611.Mar 4 2021, 5:37 PM2021-03-04 17:37:40 (UTC+1) This revision is now accepted and ready to land.Mar 4 2021, 5:38 PM2021-03-04 17:38:27 (UTC+1) Closed by commit rDAUTH63b28edb1f40: Expose a pytest plugin for swh.auth.keycloak (authored by ardumont). · Explain WhyMar 4 2021, 5:41 PM2021-03-04 17:41:41 (UTC+1) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 18612 MANIFEST.in
conftest.py
swh/auth/pytest_plugin.py
swh/auth/tests/conftest.py
|
why is the whole collision detection block is now run only if check_missing is True?