Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
af1d829
feat: add mochawesome reporter
namsnath Feb 26, 2025
563d846
update: makes test utils/server use applications
namsnath Feb 26, 2025
b0c0c80
feat: setup mochawesome
namsnath Feb 26, 2025
88592f5
update: `emailverification` tests use core apps
namsnath Feb 26, 2025
4f39c10
update: `embed` tests use core apps
namsnath Mar 3, 2025
6024a79
update: `generalerror` tests use core apps
namsnath Mar 3, 2025
12c746d
update: `getRedirectionURL` tests use core apps
namsnath Mar 4, 2025
f04a0aa
update: remove assertion on creating new apps
namsnath Mar 4, 2025
b594b47
update: `mfa.chooserscreen` tests use core apps
namsnath Mar 4, 2025
5fe3583
feat: adds mocha envs to test config
namsnath Mar 4, 2025
7b2737b
lint: format code
namsnath Mar 4, 2025
d15d143
update: `accountlinking` tests use core apps
namsnath Mar 4, 2025
374efc2
update: `mfa.default_reqs` tests use core apps
namsnath Mar 4, 2025
4d4babd
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
50e27c5
update: `mfa.factorscreen.otp` tests use core apps
namsnath Mar 7, 2025
aa21029
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
632ceb9
update: `mfa.factorscreen.totp` tests use core apps
namsnath Mar 7, 2025
ecbd775
update: add missing backend hooks
namsnath Mar 11, 2025
a39dbcd
update: `mfa.firstFactors` tests use core apps
namsnath Mar 11, 2025
99a2fe4
update: `mfa.requirement_handling` tests use core apps
namsnath Mar 11, 2025
f1dc17d
update: `mfa.signin` tests use core apps
namsnath Mar 11, 2025
798f94d
update: `multitenancy.dynamic_login_methods` tests use core apps
namsnath Mar 11, 2025
1e234a7
update: `multitenancy.tenant_interactions` tests use core apps
namsnath Mar 11, 2025
6fa736e
update: `oauth2provider` tests use core apps
namsnath Mar 11, 2025
076ad72
update: `resetpasswordusingtoken` tests use core apps
namsnath Mar 12, 2025
c191df6
update: `signin-rrdv5/6` tests use core apps
namsnath Mar 12, 2025
ebf006a
update: few `thirdparty` tests use core apps
namsnath Mar 12, 2025
fe6ec9d
update: removes `visual` tests
namsnath Mar 12, 2025
1276cff
removes usages of old helper functions
namsnath Mar 12, 2025
a6bc0e0
update: `userContext`/`userroles` tests use core apps
namsnath Mar 12, 2025
a945c19
fix: broken tests, update configs
namsnath Mar 14, 2025
7680d46
update: remove log
namsnath Mar 14, 2025
35382e6
fix: correct setup ST url
namsnath Mar 19, 2025
5abd7e4
test: only run few tests
namsnath Mar 19, 2025
ea71c89
revert: test: only run few tests
namsnath Mar 20, 2025
d392e7f
Fix package-lock issues
deepjyoti30-st Mar 25, 2025
426972d
Add some fixes for userContext and test server
deepjyoti30-st Mar 25, 2025
f3786f7
Port all webauthn tests to use updated test structure
deepjyoti30-st Mar 27, 2025
4e678b1
update: remove spec config in mocha
namsnath Mar 25, 2025
14f3269
Add init workflow for auth-react e2e tests
deepjyoti30-st Mar 31, 2025
c9b145d
Whitelist ci branch for tests
deepjyoti30-st Mar 31, 2025
e930efc
Remove cdi version related code
deepjyoti30-st Mar 31, 2025
14cf0e1
Add support for starting core in the tests
deepjyoti30-st Mar 31, 2025
c32289e
Add compose for starting up core
deepjyoti30-st Mar 31, 2025
704f378
Explicitly pass APP_SERVER port in envs
deepjyoti30-st Apr 1, 2025
ca2c19d
Use alternative approach to pass spec files to test action
deepjyoti30-st Apr 1, 2025
42001da
Parse the spec array into JSON to iterate through it
deepjyoti30-st Apr 1, 2025
d0e9c5c
Make some improvements in the workflow
deepjyoti30-st Apr 1, 2025
22273c1
Add changes to run tests in a different workflow
deepjyoti30-st Apr 4, 2025
99cdb69
Update workflow to make it ready for merge
deepjyoti30-st Apr 7, 2025
c6ed51d
Add workflow for unit tests
deepjyoti30-st Apr 11, 2025
bb27cd2
Remove current branch from list of allowed branches in unit test
deepjyoti30-st Apr 11, 2025
022d4de
Get rid of using random UUID for appId
deepjyoti30-st Apr 15, 2025
59aca22
Rename Core test to Core Functionality
deepjyoti30-st Apr 15, 2025
35b5fa8
Get rid of a TODO
deepjyoti30-st Apr 15, 2025
bc6c878
Get rid of using timeout in tests
deepjyoti30-st Apr 16, 2025
2210b03
Get rid of setting appId from tests directly
deepjyoti30-st Apr 16, 2025
4f3370f
Merge pull request #884 from supertokens/ci/github-actions/auth-react…
sattvikc Apr 21, 2025
1fa2cb1
fix: failing auth-react tests [0.49] (#895)
namsnath Apr 29, 2025
6452530
feat: webauthn test flows (#883)
deepjyoti30-st Jun 5, 2025
9d15cab
fix: separate helper method from test file (#900)
deepjyoti30-st Jun 19, 2025
7dce2da
feat: adds dev/release tag pipelines
namsnath Aug 7, 2025
fa82faf
update: makes chromatic tests run on dev tag
namsnath Aug 7, 2025
204b300
update: web js interface variable to match action output
namsnath Aug 8, 2025
89be2ff
doc: adds changelog
namsnath Aug 8, 2025
a03aae8
update: GHA concurrency to cancel runs if new commit pushed
namsnath Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/auth-react-test-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Auth-React Tests - L1

on:
pull_request:
types:
- opened
- reopened
- synchronize
push:
tags:
- dev-v[0-9]+.[0-9]+.[0-9]+

# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
# Previous runs will be cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
steps:
- uses: actions/checkout@v4
- uses: supertokens/get-supported-versions-action@main
id: versions
with:
has-fdi: true

setup-auth-react:
runs-on: ubuntu-latest
needs: define-versions
strategy:
fail-fast: true
matrix:
fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}

outputs:
AUTH_REACT__LOG_DIR: ${{ steps.envs.outputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ steps.envs.outputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
specs: ${{ steps.envs.outputs.specs }}
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}

steps:
- uses: supertokens/get-versions-action@main
id: versions
with:
driver-name: node
fdi-version: ${{ matrix.fdi-version }}
env:
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}

- uses: supertokens/auth-react-testing-action/setup@main
id: envs
with:
auth-react-version: ${{ github.sha }}
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
fdi-version: ${{ matrix.fdi-version }}
use-common-app-and-test-server: "true"

launch-test-workflow:
uses: ./.github/workflows/auth-react-test-2.yml
needs: setup-auth-react
name: FDI ${{ matrix.fdi-version }}
strategy:
max-parallel: 1 # This is important to avoid ddos GHA API
fail-fast: false # Don't fail fast to avoid locking TF State
matrix:
fdi-version: ${{ fromJSON(needs.setup-auth-react.outputs.fdiVersions) }}
with:
fdi-version: ${{ matrix.fdi-version }}
specs: ${{ needs.setup-auth-react.outputs.specs }}
AUTH_REACT__LOG_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__APP_SERVER }}
AUTH_REACT__NODE_PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ needs.setup-auth-react.outputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__PORT }}
82 changes: 82 additions & 0 deletions .github/workflows/auth-react-test-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Auth-React Tests - L2
on:
workflow_call:
inputs:
fdi-version:
description: "FDI Version"
required: true
type: string

specs:
description: "Spec Files"
required: true
type: string

AUTH_REACT__LOG_DIR:
description: AUTH_REACT__LOG_DIR
required: true
type: string

AUTH_REACT__SCREENSHOT_DIR:
description: AUTH_REACT__SCREENSHOT_DIR
required: true
type: string

AUTH_REACT__APP_SERVER:
description: AUTH_REACT__APP_SERVER
required: true
type: string

AUTH_REACT__NODE_PORT:
description: AUTH_REACT__NODE_PORT
required: true
type: string

AUTH_REACT__TEST_MODE:
description: AUTH_REACT__TEST_MODE
required: true
type: string

AUTH_REACT__PORT:
description: AUTH_REACT__PORT
required: true
type: string

jobs:
test:
runs-on: ubuntu-latest

strategy:
max-parallel: 10
fail-fast: false
matrix:
spec: ${{ fromJSON(inputs.specs) }}

env:
SUPERTOKENS_CORE_PORT: 3567
SUPERTOKENS_CORE_HOST: localhost
TEST_MODE: testing
# Auth react setup envs
AUTH_REACT__LOG_DIR: ${{ inputs.AUTH_REACT__LOG_DIR }}
AUTH_REACT__SCREENSHOT_DIR: ${{ inputs.AUTH_REACT__SCREENSHOT_DIR }}
AUTH_REACT__NODE_PORT: ${{ inputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__APP_SERVER: ${{ inputs.AUTH_REACT__NODE_PORT }}
AUTH_REACT__TEST_MODE: ${{ inputs.AUTH_REACT__TEST_MODE }}
AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }}

steps:
- uses: actions/checkout@v4
with:
path: supertokens-auth-react

- name: Start core
run: docker compose up --wait
working-directory: supertokens-auth-react

- uses: supertokens/auth-react-testing-action@main
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}
with:
fdi-version: ${{ inputs.fdi-version }}
check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]"
path: supertokens-auth-react
spec: ${{ matrix.spec }}
12 changes: 11 additions & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ name: "Chromatic"

on:
push:
branches: [master, "[0-9]*.[0-9]*"]
branches:
- master
- "[0-9]*.[0-9]*"
tags:
- dev-v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch:

# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
# Previous runs will be cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
chromatic:
runs-on: ubuntu-latest
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/pipeline-dev-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: "Dev Tag Pipeline"

on:
workflow_dispatch:
inputs:
branch:
description: The branch to create the dev tag on
type: string
required: true

permissions:
contents: write

jobs:
setup:
runs-on: ubuntu-latest

outputs:
packageVersion: ${{ steps.versions.outputs.packageVersion }}
packageVersionXy: ${{ steps.versions.outputs.packageVersionXy }}
packageLockVersion: ${{ steps.versions.outputs.packageLockVersion }}
packageLockVersionXy: ${{ steps.versions.outputs.packageLockVersionXy }}
newestVersion: ${{ steps.versions.outputs.newestVersion }}
targetBranch: ${{ steps.versions.outputs.targetBranch }}
devTag: ${{ steps.versions.outputs.devTag }}
releaseTag: ${{ steps.versions.outputs.releaseTag }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
# Need a complete fetch to make the master merge check work
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.ALL_REPO_PAT }}

- name: Setup git
run: |
# NOTE: The user email is {user.id}+{user.login}@users.noreply.github.com.
# See users API: https://api.github.com/users/github-actions%5Bbot%5D
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git fetch origin master

- name: Check if branch needs master merge
run: |
if [[ $(git log origin/master ^HEAD) != "" ]]; then
echo "You need to merge master into this branch."
exit 1
fi

- name: Populate variables
id: versions
run: |
. ./hooks/populate-hook-constants.sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a step to ensure the script is executable before sourcing it:

chmod +x ./hooks/populate-hook-constants.sh
. ./hooks/populate-hook-constants.sh

This prevents potential permission issues after checkout, as Git doesn't always preserve executable permissions across systems.

Suggested change
. ./hooks/populate-hook-constants.sh
chmod +x ./hooks/populate-hook-constants.sh
. ./hooks/populate-hook-constants.sh

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.


echo "packageVersion=$packageVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "packageVersionXy=$packageVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "packageLockVersion=$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "packageLockVersionXy=$packageLockVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"

echo "devTag=dev-v$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "releaseTag=v$packageLockVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"

- name: Check tag and branch correctness
run: |
if [[ "${{ steps.versions.outputs.packageVersion }}" != "${{ steps.versions.outputs.packageLockVersion }}" ]]
then
echo "The package version and package lock version do not match."
exit 1
fi

if [[ "${{ steps.versions.outputs.packageVersion }}" != ${{ inputs.branch }}* ]]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch comparison has a quoting issue that could lead to shell interpretation problems. The right side of the comparison should be quoted:

if [[ "${{ steps.versions.outputs.packageVersion }}" != "${{ inputs.branch }}"* ]]

This ensures that any special characters in the branch name are treated as literals rather than being interpreted by the shell.

Suggested change
if [[ "${{ steps.versions.outputs.packageVersion }}" != ${{ inputs.branch }}* ]]
if [[ "${{ steps.versions.outputs.packageVersion }}" != "${{ inputs.branch }}"* ]]

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

then
echo "Adding tag to wrong branch"
exit 1
fi

if git rev-parse ${{ steps.versions.outputs.releaseTag }} >/dev/null 2>&1
then
echo "The released version of this tag already exists."
exit 1
fi

- name: Delete tag if already tagged
run: |
git tag --delete ${{ steps.versions.outputs.devTag }} || true
git push --delete origin ${{ steps.versions.outputs.devTag }} || true

- name: Install dependencies
run: npm install

- name: Build docs
run: |
npm run build-pretty
npm run build-docs

- name: Commit doc changes
run: |
git add --all
git commit --allow-empty -nm "doc: update docs for ${{ steps.versions.outputs.releaseTag }} tag"
git push

- name: Create and push tag
run: |
# NOTE: The user email is {user.id}+{user.login}@users.noreply.github.com.
# See users API: https://api.github.com/users/github-actions%5Bbot%5D
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

git tag ${{ steps.versions.outputs.devTag }}
git push --tags --follow-tags

mark-dev-tag-as-not-passed:
runs-on: ubuntu-latest
needs:
- setup

steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.devTag }}
fetch-tags: true

- id: versions
uses: supertokens/get-supported-versions-action@main
with:
has-cdi: false
has-fdi: true
has-web-js: true

- id: escape-versions
run: |
echo "fdiVersions=$(sed 's/"/\\"/g' <<< '${{ steps.versions.outputs.fdiVersions }}')" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"
echo "webJsInterfaceVersion=$(sed 's/"/\\"/g' <<< '${{ steps.versions.outputs.webJsInterfaceVersion }}')" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"

- run: |
./hooks/populate-hook-constants.sh

curl --fail-with-body -X PUT \
https://api.supertokens.io/0/frontend \
-H 'Content-Type: application/json' \
-H 'api-version: 1' \
-d "{
\"password\": \"${{ secrets.SUPERTOKENS_API_KEY }}\",
\"version\":\"${{ needs.setup.outputs.packageVersion }}\",
\"name\": \"auth-react\",
\"frontendDriverInterfaces\": ${{ steps.escape-versions.outputs.fdiVersions }},
\"webJsInterface\": \"${{ steps.escape-versions.outputs.webJsInterfaceVersion }}\"
}"
Loading
Loading