Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
37a2948
update: `embed` tests use core apps
namsnath Mar 3, 2025
fb98117
update: `generalerror` tests use core apps
namsnath Mar 3, 2025
50c6afe
update: `getRedirectionURL` tests use core apps
namsnath Mar 4, 2025
cc50462
update: remove assertion on creating new apps
namsnath Mar 4, 2025
e9e15bf
feat: adds mocha envs to test config
namsnath Mar 4, 2025
61a88a7
lint: format code
namsnath Mar 4, 2025
b3010f6
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
31c12b1
refactor: split app creation and ST setup utils
namsnath Mar 7, 2025
a65776c
update: `multitenancy.tenant_interactions` tests use core apps
namsnath Mar 11, 2025
1f7db60
update: `oauth2provider` tests use core apps
namsnath Mar 11, 2025
2b30102
update: `resetpasswordusingtoken` tests use core apps
namsnath Mar 12, 2025
9e05e49
update: `signin-rrdv5/6` tests use core apps
namsnath Mar 12, 2025
7a0d62d
update: few `thirdparty` tests use core apps
namsnath Mar 12, 2025
c9148c5
update: removes `visual` tests
namsnath Mar 12, 2025
9b224f7
removes usages of old helper functions
namsnath Mar 12, 2025
c818461
update: `userContext`/`userroles` tests use core apps
namsnath Mar 12, 2025
0e290d5
fix: broken tests, update configs
namsnath Mar 14, 2025
fc4b4aa
update: remove log
namsnath Mar 14, 2025
d54308a
fix: correct setup ST url
namsnath Mar 19, 2025
e2758fe
test: only run few tests
namsnath Mar 19, 2025
5c611a4
revert: test: only run few tests
namsnath Mar 20, 2025
8cf3936
Fix package-lock issues
deepjyoti30-st Mar 25, 2025
54fa7f4
Add some fixes for userContext and test server
deepjyoti30-st Mar 25, 2025
4db1aa0
update: remove spec config in mocha
namsnath Mar 25, 2025
37aef5d
Add mochawesome as dep and fix package-lock
deepjyoti30-st Apr 7, 2025
5ba1c83
Fix all tests to make them compatible with unified core setup
deepjyoti30-st Apr 7, 2025
7d65308
Add fixes for tests to make them run
deepjyoti30-st Apr 9, 2025
556d535
Add compose and workflows for running the tests
deepjyoti30-st Apr 9, 2025
b961b4b
Accept incoming changes for dynamic login methods test
deepjyoti30-st Apr 14, 2025
27a6344
Add some fixes to the tests
deepjyoti30-st Apr 9, 2025
ec79366
update: `multitenancy.dynamic_login_methods` tests use core apps
namsnath Mar 11, 2025
47bd879
Add fixes for tests upto signup
deepjyoti30-st Apr 9, 2025
65ada01
Add fix for no providers enabled on the backend test
deepjyoti30-st Apr 10, 2025
d86c6b9
Fix issues with failing test that was skipped
deepjyoti30-st Apr 10, 2025
ced6289
Fix all tests to ensure they pass
deepjyoti30-st Apr 15, 2025
50b3a54
Get rid of using random UUID for appId
deepjyoti30-st Apr 15, 2025
c251013
Rename Core test to Core Functionality
deepjyoti30-st Apr 15, 2025
8319755
Get rid of a TODO
deepjyoti30-st Apr 15, 2025
ccded94
Get rid of using timeout in tests
deepjyoti30-st Apr 16, 2025
8fb39ce
Get rid of setting appId from tests directly
deepjyoti30-st Apr 16, 2025
d890f78
fix: issues with some tests failing due to imports
deepjyoti30-st Apr 17, 2025
b7b9b13
Remove a redundant test
deepjyoti30-st Apr 17, 2025
e3eba44
Add fix for existing user failing to be signed up
deepjyoti30-st Apr 17, 2025
97a5321
Stop deleteUser execution if user is not found
deepjyoti30-st Apr 17, 2025
6adde2f
fix: /deleteUser base URL to point to app server
namsnath Apr 17, 2025
725d168
update: removes tests added in backport, fixes broken tests
namsnath Apr 17, 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
81 changes: 81 additions & 0 deletions .github/workflows/auth-react-test-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Auth-React Tests - L1

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 }}
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: ${{ steps.versions.outputs.authReactTag }}
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 }}
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