Skip to content

Commit 79f3ca2

Browse files
committed
ci: update new job to match latest patterns and rebuild
1 parent d9249e9 commit 79f3ca2

File tree

11 files changed

+81
-90
lines changed

11 files changed

+81
-90
lines changed

.github/workflows/unit-test.yml

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,67 @@
11
name: "Unit Tests"
22

33
on:
4-
pull_request:
5-
types:
6-
- opened
7-
- reopened
8-
- synchronize
9-
push:
10-
branches:
11-
- master
12-
- "v[0-9]+.[0-9]+"
13-
tags:
14-
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
- labeled
10+
- unlabeled
11+
push:
12+
branches:
13+
- "[0-9]+.[0-9]+"
14+
15+
# Only one instance of this workflow will run on the same ref (PR/Branch/Tag)
16+
# Previous runs will be cancelled.
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
1520

1621
jobs:
17-
define-versions:
18-
runs-on: ubuntu-latest
19-
outputs:
20-
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
21-
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
22-
nodeVersions: '["18.20", "20.19", "22.14"]'
23-
steps:
24-
- uses: actions/checkout@v4
25-
- uses: supertokens/get-supported-versions-action@main
26-
id: versions
27-
with:
28-
has-fdi: true
29-
has-cdi: true
22+
define-versions:
23+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
24+
runs-on: ubuntu-latest
25+
outputs:
26+
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
27+
cdiVersions: ${{ steps.versions.outputs.cdiVersions }}
28+
nodeVersions: '["18.20", "20.19", "22.14"]'
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: supertokens/get-supported-versions-action@main
32+
id: versions
33+
with:
34+
has-fdi: true
35+
has-cdi: true
3036

31-
test:
32-
runs-on: ubuntu-latest
33-
needs: define-versions
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
node-version: ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
38-
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
39-
steps:
40-
- uses: actions/checkout@v4
41-
- uses: supertokens/get-versions-action@main
42-
id: versions
43-
with:
44-
driver-name: node
45-
cdi-version: ${{ matrix.cdi-version }}
46-
env:
47-
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
48-
- uses: actions/setup-node@v4
49-
with:
50-
node-version: ${{ matrix.node-version }}
51-
- name: Install dependencies
52-
run: |
53-
npm install
54-
- name: Run unit tests
55-
run: |
56-
docker compose up --wait
57-
npm run test
58-
docker compose down
59-
env:
60-
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}
37+
test:
38+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests')
39+
runs-on: ubuntu-latest
40+
needs: define-versions
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
node-version: ${{ fromJSON(needs.define-versions.outputs.nodeVersions) }}
45+
cdi-version: ${{ fromJSON(needs.define-versions.outputs.cdiVersions) }}
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: supertokens/get-versions-action@main
49+
id: versions
50+
with:
51+
driver-name: node
52+
cdi-version: ${{ matrix.cdi-version }}
53+
env:
54+
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
55+
- uses: actions/setup-node@v4
56+
with:
57+
node-version: ${{ matrix.node-version }}
58+
- name: Install dependencies
59+
run: |
60+
npm install
61+
- name: Run unit tests
62+
run: |
63+
docker compose up --wait
64+
npm run test
65+
docker compose down
66+
env:
67+
SUPERTOKENS_CORE_VERSION: ${{ steps.versions.outputs.coreVersionXy }}

.mocharc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ timeout: 40000
66
reporter: mocha-multi-reporters
77
require: test/hooks.js
88
reporter-option:
9-
- configFile=mocha-multi-reporters.json
9+
- configFile=mocha-multi-reporters.json

lib/build/recipe/oauth2provider/constants.js

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/recipe/session/constants.js

Lines changed: 1 addition & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mocha-multi-reporters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"mochaJsonOutputReporterReporterOptions": {
77
"output": "test-results.json"
88
}
9-
}
9+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,4 @@
196196
"browser": {
197197
"fs": false
198198
}
199-
}
199+
}

test/emailpassword/override.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ describe(`overrideTest: ${printPath("[test/emailpassword/override.test.js]")}`,
9797
loginMethods: [
9898
{
9999
...response.user.loginMethods[0],
100-
recipeUserId: response.user.loginMethods[0].recipeUserId.getAsString(),
100+
recipeUserId:
101+
response.user.loginMethods[0].recipeUserId.getAsString(),
101102
},
102103
],
103104
};
@@ -116,7 +117,8 @@ describe(`overrideTest: ${printPath("[test/emailpassword/override.test.js]")}`,
116117
loginMethods: [
117118
{
118119
...response.user.loginMethods[0],
119-
recipeUserId: response.user.loginMethods[0].recipeUserId.getAsString(),
120+
recipeUserId:
121+
response.user.loginMethods[0].recipeUserId.getAsString(),
120122
},
121123
],
122124
};
@@ -234,7 +236,8 @@ describe(`overrideTest: ${printPath("[test/emailpassword/override.test.js]")}`,
234236
loginMethods: [
235237
{
236238
...response.user.loginMethods[0],
237-
recipeUserId: response.user.loginMethods[0].recipeUserId.getAsString(),
239+
recipeUserId:
240+
response.user.loginMethods[0].recipeUserId.getAsString(),
238241
},
239242
],
240243
};
@@ -253,7 +256,8 @@ describe(`overrideTest: ${printPath("[test/emailpassword/override.test.js]")}`,
253256
loginMethods: [
254257
{
255258
...response.user.loginMethods[0],
256-
recipeUserId: response.user.loginMethods[0].recipeUserId.getAsString(),
259+
recipeUserId:
260+
response.user.loginMethods[0].recipeUserId.getAsString(),
257261
},
258262
],
259263
};

test/session/sessionHandlingFuncsWithoutReq.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ describe(`Session handling functions without modifying response: ${printPath(
434434
tokensAfterRefresh.refreshToken,
435435
true
436436
);
437-
const tokensAfterRefreshWithDisable = sessionAfterRefreshWithDisabledAntiCsrf.getAllSessionTokensDangerously();
437+
const tokensAfterRefreshWithDisable =
438+
sessionAfterRefreshWithDisabledAntiCsrf.getAllSessionTokensDangerously();
438439
assert.strictEqual(tokensAfterRefreshWithDisable.accessAndFrontTokenUpdated, true);
439440
});
440441

test/thirdparty/oidc.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe(`oidcTest: ${printPath("[test/thirdparty/oidc.test.js]")}`, function ()
2626
ProcessState.getInstance().reset();
2727
});
2828

29-
3029
it("should use code challenge method S256 if supported by the provider", async function () {
3130
const connectionURI = await createCoreApplicationWithMultitenancy();
3231

test/thirdparty/override.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ describe(`overrideTest: ${printPath("[test/thirdparty/override.test.js]")}`, fun
269269
loginMethods: [
270270
{
271271
...response.user.loginMethods[0],
272-
recipeUserId: response.user.loginMethods[0].recipeUserId.getAsString(),
272+
recipeUserId:
273+
response.user.loginMethods[0].recipeUserId.getAsString(),
273274
},
274275
],
275276
};

0 commit comments

Comments
 (0)