Skip to content

Commit 6f0d27b

Browse files
authored
feat: adds flutter unit tests and report (#343)
* feat: adds flutter unit tests and report * fix: cspell * feat: update ci version * feat: adds tojson lib * feat: adds lib output * fix: remove test report leftover * fix: cspell
1 parent 5e144cc commit 6f0d27b

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

.config/dictionaries/project.dic

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ coti
2828
cryptoxide
2929
Cunego
3030
Cupertino
31+
dalek
3132
dbsync
3233
delegators
3334
DIND
@@ -65,6 +66,8 @@ Joaquín
6566
jorm
6667
jormungandr
6768
Jörmungandr
69+
junitreport
70+
Keyhash
6871
lcov
6972
Leshiy
7073
lintfix
@@ -114,6 +117,7 @@ rxdart
114117
saibatizoku
115118
schemathesis
116119
Schemathesis
120+
Scripthash
117121
seckey
118122
sendfile
119123
slotno
@@ -128,11 +132,13 @@ testunit
128132
thiserror
129133
thollander
130134
timelike
135+
tojunit
131136
Traceback
132137
TXNZD
133138
unmanaged
134139
UTXO
135140
vitss
141+
vkey
136142
voteplan
137143
voteplans
138144
wallclock
@@ -144,7 +150,3 @@ xctest
144150
xctestrun
145151
xcworkspace
146152
yoroi
147-
dalek
148-
Keyhash
149-
Scripthash
150-
vkey

.github/workflows/generate-allure-report.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
aws_region: ${{ env.AWS_REGION }}
3737
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
3838

39-
- name: Get unit test report
39+
- name: Get catalyst gateway unit test report
4040
uses: input-output-hk/catalyst-ci/actions/run@master
4141
if: always()
4242
continue-on-error: true
@@ -60,6 +60,18 @@ jobs:
6060
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
6161
artifact: "false"
6262

63+
- name: Get flutter unit test report
64+
uses: input-output-hk/catalyst-ci/actions/run@master
65+
if: always()
66+
continue-on-error: true
67+
with:
68+
earthfile: ./catalyst_voices/
69+
flags:
70+
targets: test-unit
71+
target_flags:
72+
runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
73+
artifact: "false"
74+
6375
- name: Collect and upload test reports
6476
uses: actions/upload-artifact@v4
6577
if: always()

catalyst_voices/Earthfile

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ deps:
1212
WORKDIR /frontend
1313

1414
GIT CLONE https://github.com/flutter/flutter.git /usr/local/flutter
15-
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"
16-
15+
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:$HOME/.pub-cache/bin:${PATH}"
1716
RUN flutter channel stable
1817
RUN flutter upgrade
1918
RUN flutter --version
2019
RUN flutter doctor -v
2120
RUN flutter config --enable-web
21+
RUN dart pub global activate junitreport
2222

2323
src:
2424
FROM +deps
@@ -35,6 +35,15 @@ build:
3535
WORKDIR /frontend/build
3636
SAVE ARTIFACT web /web AS LOCAL web
3737

38+
test-unit:
39+
FROM +build
40+
WORKDIR /frontend
41+
TRY
42+
RUN flutter test --reporter expanded . --machine | tojunit --output flutter.junit-report.xml
43+
FINALLY
44+
SAVE ARTIFACT flutter.junit-report.xml AS LOCAL flutter-unit-tests.junit-report.xml
45+
END
46+
3847
package:
3948
FROM nginx:alpine3.18
4049
ARG tag='latest'

catalyst_voices/test_driver/Earthfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ integration-test-web:
1919
# LET driver = "msedgedriver"
2020
#END
2121
RUN ($driver --port=$driver_port > $driver.log &) && \
22-
flutter drive --driver=test_driver/integration_test.dart \
22+
flutter drive --driver=test_driver/integration_tests.dart \
2323
--target=integration_test/main.dart \
2424
--flavor development -d web-server --profile \
2525
--browser-name=$browser --driver-port=$driver_port || echo fail > fail

0 commit comments

Comments
 (0)