-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: uses containerised core in tests (#561)
- Adds unit test workflow - Test changes: - Removes all instances of start_st, clean_st, setup_st, setup_function, teardown_function - Adds per-test setup/teardown to call `reset()` - Replaces `start_st` calls and usages of `localhost:3567` with `get_new_core_app_url` equivalents - Creates a new application in the core - Removes unused constants and functions - Adds TODOs for test cleanup - Removes `st_common_init_args` constant, prefers use of `get_st_init_args` instead - Adds actions for common tasks - https://github.com/supertokens/get-versions-action - https://github.com/supertokens/get-supported-versions-action - Updates unit test Circle CI scripts
- Loading branch information
Showing
89 changed files
with
1,149 additions
and
2,169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 16 additions & 3 deletions
19
.github/workflows/pre-commit-hook-run.yml → .github/workflows/lint-code.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
lint-pr-title: | ||
name: Lint PR Title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
validateSingleCommit: true | ||
lint-pr-title: | ||
name: Lint PR Title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
validateSingleCommit: true | ||
|
||
# Enforces the update of a changelog file on every pull request | ||
lint-changelog: | ||
name: Enforce Changelogs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dangoslen/changelog-enforcer@v2 | ||
with: | ||
changeLogPath: "CHANGELOG.md" | ||
skipLabels: "Skip-Changelog" | ||
# Enforces the update of a changelog file on every pull request | ||
lint-changelog: | ||
name: Enforce Changelogs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dangoslen/changelog-enforcer@v2 | ||
with: | ||
changeLogPath: "CHANGELOG.md" | ||
skipLabels: "Skip-Changelog" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: "Unit Tests" | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
push: | ||
branches: | ||
- master | ||
- "v[0-9]+.[0-9]+" | ||
tags: | ||
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
define-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
fdiVersions: ${{ steps.versions.outputs.fdiVersions }} | ||
cdiVersions: ${{ steps.versions.outputs.cdiVersions }} | ||
pyVersions: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: supertokens/get-supported-versions-action@main | ||
id: versions | ||
with: | ||
has-fdi: true | ||
has-cdi: true | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: define-versions | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
py-version: ${{ fromJSON(needs.define-versions.outputs.pyVersions) }} | ||
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: supertokens/get-versions-action@main | ||
id: versions | ||
with: | ||
driver-name: python | ||
cdi-version: ${{ matrix.cdi-version }} | ||
env: | ||
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.py-version }} | ||
- name: Create virtual environment and install dependencies | ||
# Updrade `pip` and `setuptools` to have the latest versions before further installs | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
python3 -m pip install pip setuptools --upgrade | ||
make dev-install && rm -rf src | ||
- name: Run unit tests | ||
run: | | ||
source venv/bin/activate | ||
make test | ||
env: | ||
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }} | ||
- uses: pmeier/pytest-results-action@main | ||
name: Surface failing tests | ||
if: always() | ||
with: | ||
path: test-results/junit.xml | ||
summary: true | ||
title: "[Core=${{ steps.versions.outputs.coreVersionXy }}][py=${{ matrix.py-version }}] Unit Test Results" |
Oops, something went wrong.