From 291ed9f0d5bdbc02d249a246b26b078dc33c882f Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Wed, 29 Oct 2025 17:13:33 +0530 Subject: [PATCH 1/2] feat: uses core in dev mode and adds log output --- .github/workflows/backend-sdk-testing.yml | 6 ++++-- compose.yml | 13 ++++++++----- tests/sessions/test_jwks.py | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/backend-sdk-testing.yml b/.github/workflows/backend-sdk-testing.yml index 41cba1724..bdd622c6c 100644 --- a/.github/workflows/backend-sdk-testing.yml +++ b/.github/workflows/backend-sdk-testing.yml @@ -92,11 +92,13 @@ jobs: run: | source venv/bin/activate docker compose up --build --wait - python3 tests/test-server/app.py &> python.log & + mkdir -p logs/ + python3 tests/test-server/app.py &> logs/python.log & + docker compose logs -f core &> logs/core.log & - uses: supertokens/backend-sdk-testing-action@main with: version: ${{ matrix.fdi-version }} check-name-suffix: '[CDI=${{ matrix.cdi-version }}][Core=${{ steps.core-version.outputs.coreVersion }}][FDI=${{ matrix.fdi-version }}][Py=${{ matrix.py-version }}][Node=${{ matrix.node-version }}]' path: backend-sdk-testing - app-server-logs: ${{ github.workspace }}/supertokens-python/python.log + app-server-logs: ${{ github.workspace }}/supertokens-python/logs diff --git a/compose.yml b/compose.yml index 3008166dd..4c16f9672 100644 --- a/compose.yml +++ b/compose.yml @@ -2,11 +2,11 @@ services: core: # Uses `$SUPERTOKENS_CORE_VERSION` when available, else latest image: supertokens/supertokens-dev-postgresql:${SUPERTOKENS_CORE_VERSION:-master} - # entrypoint: [ - # "/usr/lib/supertokens/jre/bin/java", - # "-classpath", "/usr/lib/supertokens/core/*:/usr/lib/supertokens/plugin-interface/*:/usr/lib/supertokens/ee/*", - # "io.supertokens.Main", "/usr/lib/supertokens/", "DEV", "test_mode" - # ] + entrypoint: [ + "/usr/lib/supertokens/jre/bin/java", + "-classpath", "/usr/lib/supertokens/core/*:/usr/lib/supertokens/plugin-interface/*:/usr/lib/supertokens/ee/*", + "io.supertokens.Main", "/usr/lib/supertokens/", "DEV", "test_mode" + ] ports: # Uses `$SUPERTOKENS_CORE_PORT` when available, else 3567 for local port - ${SUPERTOKENS_CORE_PORT:-3567}:3567 @@ -17,6 +17,9 @@ services: OAUTH_PROVIDER_ADMIN_SERVICE_URL: http://oauth:4445 OAUTH_PROVIDER_CONSENT_LOGIN_BASE_URL: http://localhost:3001/auth OAUTH_CLIENT_SECRET_ENCRYPTION_KEY: asdfasdfasdfasdfasdf + INFO_LOG_PATH: "null" + ERROR_LOG_PATH: "null" + LOG_LEVEL: "DEBUG" healthcheck: test: bash -c 'curl -s "http://127.0.0.1:3567/hello" | grep "Hello"' interval: 10s diff --git a/tests/sessions/test_jwks.py b/tests/sessions/test_jwks.py index 14dd24b19..cff6d0eaf 100644 --- a/tests/sessions/test_jwks.py +++ b/tests/sessions/test_jwks.py @@ -105,7 +105,7 @@ async def test_that_jwks_is_fetched_as_expected(caplog: LogCaptureFixture): JWKSConfig.update(original_jwks_config) -@pytest.mark.skip("Requires core running in DEV + test_mode") +# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_jwks_result_is_refreshed_properly(caplog: LogCaptureFixture): """This test verifies that the cache used to store the pointer to the JWKS result is updated properly when the cache expired and the keys need to be refetched. @@ -161,7 +161,7 @@ async def test_that_jwks_result_is_refreshed_properly(caplog: LogCaptureFixture) JWKSConfig.update(original_jwks_config) -@pytest.mark.skip("Requires core running in DEV + test_mode") +# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_jwks_are_refresh_if_kid_is_unknown(caplog: LogCaptureFixture): """This test verifies that the SDK tried to re-fetch the keys from the core if the KID for the access token does not exist in the cache @@ -607,7 +607,7 @@ async def test_session_verification_of_jwt_with_dynamic_signing_key(): assert s_.get_user_id() == "userId" -@pytest.mark.skip("Requires core running in DEV + test_mode") +# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_locking_for_jwks_cache_works(caplog: LogCaptureFixture): caplog.set_level(logging.DEBUG) not_returned_from_cache_count = get_log_occurence_count( From d4302191a6f331534138de078bd240a5f6a9aae5 Mon Sep 17 00:00:00 2001 From: Namit Nathwani Date: Wed, 29 Oct 2025 17:14:08 +0530 Subject: [PATCH 2/2] chore: removes comments --- tests/sessions/test_jwks.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/sessions/test_jwks.py b/tests/sessions/test_jwks.py index cff6d0eaf..c89a971a8 100644 --- a/tests/sessions/test_jwks.py +++ b/tests/sessions/test_jwks.py @@ -105,7 +105,6 @@ async def test_that_jwks_is_fetched_as_expected(caplog: LogCaptureFixture): JWKSConfig.update(original_jwks_config) -# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_jwks_result_is_refreshed_properly(caplog: LogCaptureFixture): """This test verifies that the cache used to store the pointer to the JWKS result is updated properly when the cache expired and the keys need to be refetched. @@ -161,7 +160,6 @@ async def test_that_jwks_result_is_refreshed_properly(caplog: LogCaptureFixture) JWKSConfig.update(original_jwks_config) -# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_jwks_are_refresh_if_kid_is_unknown(caplog: LogCaptureFixture): """This test verifies that the SDK tried to re-fetch the keys from the core if the KID for the access token does not exist in the cache @@ -607,7 +605,6 @@ async def test_session_verification_of_jwt_with_dynamic_signing_key(): assert s_.get_user_id() == "userId" -# @pytest.mark.skip("Requires core running in DEV + test_mode") async def test_that_locking_for_jwks_cache_works(caplog: LogCaptureFixture): caplog.set_level(logging.DEBUG) not_returned_from_cache_count = get_log_occurence_count(