Skip to content

Commit d69a59f

Browse files
committed
experiment: parallel running tests
1 parent 8f4c181 commit d69a59f

1 file changed

Lines changed: 61 additions & 62 deletions

File tree

.github/workflows/unit-test.yml

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -47,65 +47,64 @@ jobs:
4747
- sqlite
4848
- postgresql
4949
steps:
50-
- steps:
51-
- name: Set up JDK 15.0.1
52-
uses: actions/setup-java@v2
53-
with:
54-
java-version: 15.0.1
55-
distribution: zulu
56-
- uses: actions/checkout@v2
57-
with:
58-
repository: supertokens/supertokens-root
59-
path: ./supertokens-root
60-
ref: for_jdk_15_releases
61-
- uses: actions/checkout@v2
62-
with:
63-
path: ./supertokens-root/supertokens-core
64-
- uses: actions/checkout@v2
65-
with:
66-
repository: supertokens/supertokens-plugin-interface
67-
path: ./supertokens-root/supertokens-plugin-interface
68-
ref: ${{ fromJson(needs.dependency-branches.outputs.branches)['plugin-interface'] }}
69-
- uses: actions/checkout@v2
70-
if: matrix.plugin != 'sqlite'
71-
with:
72-
repository: supertokens/supertokens-${{ matrix.plugin }}-plugin
73-
path: ./supertokens-root/supertokens-${{ matrix.plugin }}-plugin
74-
ref: ${{ fromJson(needs.dependency-branches.outputs.branches)[matrix.plugin] }}
75-
- name: Load Modules
76-
run: |
77-
cd supertokens-root
78-
echo "core,master
79-
plugin-interface,master
80-
${{ matrix.plugin }}-plugin,master
81-
" > modules.txt
82-
cat modules.txt
83-
./loadModules
84-
- name: Setup test env
85-
run: cd supertokens-root && ./utils/setupTestEnv --local
86-
- name: Start ${{ matrix.plugin }} server
87-
if: matrix.plugin != 'sqlite'
88-
run: cd supertokens-root/supertokens-${{ matrix.plugin }}-plugin && ./startDb.sh
89-
- uses: actions/checkout@v2
90-
- uses: chaosaffe/split-tests@v1-alpha.1
91-
id: split-tests
92-
name: Split tests
93-
with:
94-
glob: 'src/test/java/**/*.java'
95-
split-total: ${{ env.total-runners }}
96-
split-index: ${{ matrix.runner-index }}
97-
- run: 'echo "This runner will execute the following tests: ${{ steps.split-tests.outputs.test-suite }}"'
98-
- name: Run tests
99-
env:
100-
ST_PLUGIN_NAME: ${{ matrix.plugin }}
101-
run: |
102-
cd supertokens-root
103-
./gradlew test ${{ steps.split-tests.outputs.test-suite }}
104-
- name: Publish Test Report
105-
uses: mikepenz/action-junit-report@v5
106-
if: always()
107-
with:
108-
report_paths: '**/build/test-results/test/TEST-*.xml'
109-
detailed_summary: true
110-
include_passed: false
111-
annotate_notice: true
50+
- name: Set up JDK 15.0.1
51+
uses: actions/setup-java@v2
52+
with:
53+
java-version: 15.0.1
54+
distribution: zulu
55+
- uses: actions/checkout@v2
56+
with:
57+
repository: supertokens/supertokens-root
58+
path: ./supertokens-root
59+
ref: for_jdk_15_releases
60+
- uses: actions/checkout@v2
61+
with:
62+
path: ./supertokens-root/supertokens-core
63+
- uses: actions/checkout@v2
64+
with:
65+
repository: supertokens/supertokens-plugin-interface
66+
path: ./supertokens-root/supertokens-plugin-interface
67+
ref: ${{ fromJson(needs.dependency-branches.outputs.branches)['plugin-interface'] }}
68+
- uses: actions/checkout@v2
69+
if: matrix.plugin != 'sqlite'
70+
with:
71+
repository: supertokens/supertokens-${{ matrix.plugin }}-plugin
72+
path: ./supertokens-root/supertokens-${{ matrix.plugin }}-plugin
73+
ref: ${{ fromJson(needs.dependency-branches.outputs.branches)[matrix.plugin] }}
74+
- name: Load Modules
75+
run: |
76+
cd supertokens-root
77+
echo "core,master
78+
plugin-interface,master
79+
${{ matrix.plugin }}-plugin,master
80+
" > modules.txt
81+
cat modules.txt
82+
./loadModules
83+
- name: Setup test env
84+
run: cd supertokens-root && ./utils/setupTestEnv --local
85+
- name: Start ${{ matrix.plugin }} server
86+
if: matrix.plugin != 'sqlite'
87+
run: cd supertokens-root/supertokens-${{ matrix.plugin }}-plugin && ./startDb.sh
88+
- uses: actions/checkout@v2
89+
- uses: chaosaffe/split-tests@v1-alpha.1
90+
id: split-tests
91+
name: Split tests
92+
with:
93+
glob: 'src/test/java/**/*.java'
94+
split-total: ${{ env.total-runners }}
95+
split-index: ${{ matrix.runner-index }}
96+
- run: 'echo "This runner will execute the following tests: ${{ steps.split-tests.outputs.test-suite }}"'
97+
- name: Run tests
98+
env:
99+
ST_PLUGIN_NAME: ${{ matrix.plugin }}
100+
run: |
101+
cd supertokens-root
102+
./gradlew test ${{ steps.split-tests.outputs.test-suite }}
103+
- name: Publish Test Report
104+
uses: mikepenz/action-junit-report@v5
105+
if: always()
106+
with:
107+
report_paths: '**/build/test-results/test/TEST-*.xml'
108+
detailed_summary: true
109+
include_passed: false
110+
annotate_notice: true

0 commit comments

Comments
 (0)