@@ -51,11 +51,45 @@ permissions:
5151 checks : write
5252
5353jobs :
54+ setup-report :
55+ runs-on : [ubuntu-latest]
56+ outputs :
57+ testmo-run-id : ${{ steps.setTestRun.outputs.testmo-run-id }}
58+ steps :
59+ - name : Install testmo
60+ run : npm install --no-save @testmo/testmo-cli
61+ - name : Add url
62+ run : |
63+ npx testmo automation:resources:add-field --name git --type string \
64+ --value ${GITHUB_SHA:0:7} --resources resources.json
65+ RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
66+ npx testmo automation:resources:add-link --name build \
67+ --url $RUN_URL --resources resources.json
68+
69+ - name : Create test run
70+ run : |
71+ npx testmo automation:run:create \
72+ --instance https://mangata-finance.testmo.net \
73+ --project-id 2 \
74+ --name "BE tests from node-repo" \
75+ --resources resources.json \
76+ --source "unit-tests" > testmo-run-id.txt
77+ ID=$(cat testmo-run-id.txt)
78+ echo "testmo-run-id=$ID" >> $GITHUB_OUTPUT
79+ echo "ID=$ID" >> $GITHUB_ENV
80+
81+ env :
82+ TESTMO_URL : ${{ secrets.TESTMO_URL }}
83+ TESTMO_TOKEN : ${{ secrets.TESTMO_TOKEN }}
84+ id : setTestRun
85+
86+
5487 e2e-test-matrix :
88+ needs : [setup-report]
5589 strategy :
5690 matrix :
5791 include :
58- - command : " yarn test-parallel --max-workers=32 "
92+ - command : " yarn test-parallel --max-workers=10 "
5993 fast : false
6094 - command : " yarn test-sequential-no-bootstrap"
6195 fast : false
@@ -75,6 +109,10 @@ jobs:
75109 fast : true
76110 - command : " yarn test-governance"
77111 fast : true
112+ - command : " yarn test-multiswap"
113+ fast : false
114+ - command : " yarn test-experimentalStaking"
115+ fast : true
78116
79117 runs-on : [self-hosted, compile]
80118 timeout-minutes : 180
@@ -89,16 +127,15 @@ jobs:
89127 E2EBRANCHNAME : " main"
90128 PARACHAIN_DOCKER_IMAGE : ${{ inputs.parachainDocker || format('mangatasolutions/mangata-node:{0}', inputs.globalVersion) }}
91129 steps :
92-
93130 - uses : actions/checkout@v3 # ###IDK, but this is neccesary for reports
94131 - name : Adapt if fast runtime
95132 if : ${{ !contains(env.PARACHAIN_DOCKER_IMAGE, 'fast') && matrix.fast == true }}
96133 run : echo "PARACHAIN_DOCKER_IMAGE=${{ env.PARACHAIN_DOCKER_IMAGE }}-fast" >> $GITHUB_ENV
97-
134+
98135 - name : Adapt if fast runtime
99136 if : ${{ !contains(env.PARACHAIN_DOCKER_IMAGE, 'fast') && matrix.fast == true }}
100137 run : echo "PARACHAIN_DOCKER_IMAGE=${{ env.PARACHAIN_DOCKER_IMAGE }}-fast" >> $GITHUB_ENV
101-
138+
102139 - name : Download node Docker image
103140 if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip-build') && inputs.skipBuild != 'true' }}
104141 run : docker pull ${{ env.PARACHAIN_DOCKER_IMAGE }}
@@ -144,28 +181,24 @@ jobs:
144181 echo ${{ env.PARACHAIN_DOCKER_IMAGE }}
145182
146183 - name : Replace parachain docker image reference in config
147- working-directory : launch
184+ working-directory : devops/parachain- launch
148185 run : sed -i 's+mangatasolutions/mangata-node:.*+${{ env.PARACHAIN_DOCKER_IMAGE }}+g' config.yml
149186
150- - name : Install parachain launch dependencies
151- working-directory : launch
152- run : yarn
153-
154187 - name : Install e2e tests dependencies
155188 working-directory : e2eTests
156189 run : yarn
157190
158- - name : Generate parachain launch config
159- working-directory : launch
160- run : yarn gen
191+ - name : Run parachain launch
192+ working-directory : devops/parachain- launch
193+ run : npx @open-web3/parachain-launch generate config.yml
161194
162195 - name : Stop previous parachain if running
163- working-directory : launch
164- run : yarn down
196+ working-directory : devops/parachain- launch/output
197+ run : docker-compose down -v
165198
166199 - name : Start mangata-node parachain
167- working-directory : launch
168- run : yarn up
200+ working-directory : devops/parachain- launch/output
201+ run : docker-compose up -d --build
169202
170203 - name : Docker ps
171204 run : docker ps --no-trunc
@@ -185,6 +218,19 @@ jobs:
185218 name : E2E report ${{ matrix.command }} # Name of the check run which will be created
186219 path : e2eTests/reports/junit-*.xml # Path to test results
187220 reporter : jest-junit # Format of test results
221+ - name : Install testmo
222+ run : npm install --no-save @testmo/testmo-cli
223+ - name : Submit results to the testmo-run
224+ if : always()
225+ run : |
226+ npx testmo automation:run:submit-thread \
227+ --instance https://mangata-finance.testmo.net \
228+ --run-id ${{needs.setup-report.outputs.testmo-run-id}} \
229+ --results e2eTests/reports/*.xml
230+ env :
231+ TESTMO_URL : ${{ secrets.TESTMO_URL }}
232+ TESTMO_TOKEN : ${{ secrets.TESTMO_TOKEN }}
233+ continue-on-error : true
188234
189235 - name : Collect docker logs on failure
190236 if : failure()
@@ -216,9 +262,27 @@ jobs:
216262
217263 - name : Stop mangata-node parachain
218264 if : always()
219- working-directory : launch
220- run : yarn down
221-
265+ working-directory : devops/parachain-launch/output
266+ run : docker-compose down -v
222267 - name : Fix permissions on self-hosted runner
223268 if : always()
224- run : chown -R 1100:1100 $GITHUB_WORKSPACE
269+ run : chown -R 1100:1100 $GITHUB_WORKSPACE
270+ test-complete :
271+ needs : [setup-report, e2e-test-matrix]
272+ if : always()
273+ runs-on : ubuntu-latest
274+
275+ steps :
276+ - name : Install testmo
277+ run : npm install --no-save @testmo/testmo-cli
278+
279+ - name : Complete test run
280+ run : |
281+ npx testmo automation:run:complete \
282+ --instance https://mangata-finance.testmo.net \
283+ --run-id ${{needs.setup-report.outputs.testmo-run-id}} \
284+ env :
285+ TESTMO_URL : ${{ secrets.TESTMO_URL }}
286+ TESTMO_TOKEN : ${{ secrets.TESTMO_TOKEN }}
287+ continue-on-error : true
288+
0 commit comments