Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
18163e7
update: makes test utils/server use applications
namsnath Feb 26, 2025
6ec5b6d
feat: setup mochawesome
namsnath Feb 26, 2025
a6417a0
update: `emailverification` tests use core apps
namsnath Feb 26, 2025
fd624eb
update: `embed` tests use core apps
namsnath Mar 3, 2025
77cdb86
update: `generalerror` tests use core apps
namsnath Mar 3, 2025
e36f2b1
update: `getRedirectionURL` tests use core apps
namsnath Mar 4, 2025
fe872b1
update: remove assertion on creating new apps
namsnath Mar 4, 2025
7ddf577
update: `mfa.chooserscreen` tests use core apps
namsnath Mar 4, 2025
41a3fd1
feat: adds mocha envs to test config
namsnath Mar 4, 2025
a46fb7b
lint: format code
namsnath Mar 4, 2025
d65eaf4
update: `accountlinking` tests use core apps
namsnath Mar 4, 2025
d55fda8
update: `mfa.default_reqs` tests use core apps
namsnath Mar 4, 2025
d71e74a
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
c11dae0
update: `mfa.factorscreen.otp` tests use core apps
namsnath Mar 7, 2025
b6e5bb1
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
2041010
update: `mfa.factorscreen.totp` tests use core apps
namsnath Mar 7, 2025
b5a04ba
update: add missing backend hooks
namsnath Mar 11, 2025
b5a1b76
update: `mfa.firstFactors` tests use core apps
namsnath Mar 11, 2025
646f0d4
update: `mfa.requirement_handling` tests use core apps
namsnath Mar 11, 2025
87f778c
update: `mfa.signin` tests use core apps
namsnath Mar 11, 2025
d9f3daf
update: `multitenancy.tenant_interactions` tests use core apps
namsnath Mar 11, 2025
23dadd6
update: `oauth2provider` tests use core apps
namsnath Mar 11, 2025
d7a55f1
update: `resetpasswordusingtoken` tests use core apps
namsnath Mar 12, 2025
c37e670
update: `signin-rrdv5/6` tests use core apps
namsnath Mar 12, 2025
d1c7f48
update: few `thirdparty` tests use core apps
namsnath Mar 12, 2025
88e5ecf
update: removes `visual` tests
namsnath Mar 12, 2025
f54f19e
removes usages of old helper functions
namsnath Mar 12, 2025
eef281a
update: `userContext`/`userroles` tests use core apps
namsnath Mar 12, 2025
3da8a6c
fix: broken tests, update configs
namsnath Mar 14, 2025
10ef8d0
update: remove log
namsnath Mar 14, 2025
a965aac
fix: correct setup ST url
namsnath Mar 19, 2025
5e586a0
test: only run few tests
namsnath Mar 19, 2025
46d7103
revert: test: only run few tests
namsnath Mar 20, 2025
5bbad1f
Fix package-lock issues
deepjyoti30-st Mar 25, 2025
aa04571
Add some fixes for userContext and test server
deepjyoti30-st Mar 25, 2025
67c72c5
update: remove spec config in mocha
namsnath Mar 25, 2025
c9e289e
Add fixes for some failing updates
deepjyoti30-st Apr 2, 2025
3c77a8c
Add workflow and docker compose file for runs
deepjyoti30-st Apr 2, 2025
d0e0bb4
Modify the workflow to run in a separate workflow for test
deepjyoti30-st Apr 4, 2025
b8032dd
Fix FDI versions and branch ref
deepjyoti30-st Apr 4, 2025
ab28870
Update .github/workflows/auth-react-test-1.yml
deepjyoti30-st Apr 7, 2025
165daa3
Update workflow to make it ready for merge
deepjyoti30-st Apr 7, 2025
7e5c70f
Add unit test workflow
deepjyoti30-st Apr 11, 2025
2c8d6ec
Get rid of using random UUID for appId
deepjyoti30-st Apr 15, 2025
32c6cef
Rename Core test to Core Functionality
deepjyoti30-st Apr 15, 2025
fbbcb06
Get rid of a TODO
deepjyoti30-st Apr 15, 2025
ecad24b
Get rid of using timeout in tests
deepjyoti30-st Apr 16, 2025
f215d04
Get rid of setting appId from tests directly
deepjyoti30-st Apr 16, 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:
branches:
- master
- "v[0-9]+.[0-9]+"
- "ci/github-actions/auth-react/v0.48.0" # TODO: Remove this
tags:
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"

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) }}
fdi-version: ["4.0"]

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 }}

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: ${{ steps.versions.outputs.authReactTag }}
auth-react-version: ci/github-actions/auth-react/v0.49.0
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.define-versions.outputs.fdiVersions) }}
fdi-version: ["4.0"]
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 }}
33 changes: 0 additions & 33 deletions .github/workflows/tests-visual.yml

This file was deleted.

15 changes: 10 additions & 5 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
spec:
- test/unit/**/*.test.js
- test/end-to-end/**/*.test.js
reporter: spec
# spec:
# - test/end-to-end/**/*.test.js
slow: 20000
timeout: 30000
timeout: 40000
exit: true
require:
- "@babel/register"
- test/test.mocha.env
reporter: mocha-multi-reporters
reporter-option:
- configFile=mocha-multi-reporters.json
23 changes: 23 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
core:
# Uses `$SUPERTOKENS_CORE_VERSION` when available, else latest
image: supertokens/supertokens-core:dev-branch-${SUPERTOKENS_CORE_VERSION:-master}
ports:
# Uses `$SUPERTOKENS_CORE_PORT` when available, else 3567 for local port
- ${SUPERTOKENS_CORE_PORT:-3567}:3567
platform: linux/amd64
depends_on: [oauth]
environment:
OAUTH_PROVIDER_PUBLIC_SERVICE_URL: http://oauth:4444
OAUTH_PROVIDER_ADMIN_SERVICE_URL: http://oauth:4445
OAUTH_PROVIDER_CONSENT_LOGIN_BASE_URL: http://localhost:3001/auth
OAUTH_CLIENT_SECRET_ENCRYPTION_KEY: asdfasdfasdfasdfasdf
healthcheck:
test: bash -c 'curl -s "http://127.0.0.1:3567/hello" | grep "Hello"'
interval: 10s
timeout: 5s
retries: 5

oauth:
image: supertokens/oauth2-test:latest
platform: linux/amd64
9 changes: 9 additions & 0 deletions mocha-multi-reporters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"reporterEnabled": "mochawesome, mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "test_report/test-results.xml"
},
"mochawesomeReporterOptions": {
"reportDir": "test_report/mochawesome"
}
}
Loading
Loading