File tree Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -189,17 +189,27 @@ jobs:
189
189
args : " --manifest-path ui/Cargo.toml --all -- --check"
190
190
- name : Build backend
191
191
run : |-
192
- mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/home/rust/.cargo/git -v ~/.cargo/registry:/home/rust/.cargo/registry --workdir /ui ekidd/rust-musl-builder:stable bash -c '
192
+ mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/home/rust/.cargo/git -v ~/.cargo/registry:/home/rust/.cargo/registry --workdir /ui ekidd/rust-musl-builder:stable bash -c $ '
193
193
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
194
- cargo build --locked --target=x86_64-unknown-linux-musl --release
194
+
195
+ # Unit tests
196
+ cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
197
+ test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
198
+ mv "${test_bin}" target/unit_tests;
199
+
200
+ # Primary binary
201
+ cargo build --locked --target=x86_64-unknown-linux-musl --release;
202
+ mv target/x86_64-unknown-linux-musl/release/ui target/ui;
195
203
'
196
204
- name : Restore permissions
197
205
run : sudo chown -R runner:docker ~/.cargo/ ui/target
198
206
- name : Save backend artifact
199
207
uses : actions/upload-artifact@v2
200
208
with :
201
209
name : backend
202
- path : ui/target/x86_64-unknown-linux-musl/release/ui
210
+ path : |
211
+ ui/target/ui
212
+ ui/target/unit_tests
203
213
build_frontend :
204
214
name : Build frontend
205
215
runs-on : ubuntu-latest
@@ -293,6 +303,8 @@ jobs:
293
303
with :
294
304
name : frontend
295
305
path : tests/server/build/
306
+ - name : Run unit tests
307
+ run : chmod +x ./server/unit_tests && ./server/unit_tests
296
308
- name : Run tests
297
309
env :
298
310
PLAYGROUND_UI_ROOT : server/build/
Original file line number Diff line number Diff line change @@ -296,9 +296,17 @@ workflows:
296
296
-v ~/.cargo/registry:/home/rust/.cargo/registry
297
297
--workdir /ui
298
298
ekidd/rust-musl-builder:stable
299
- bash -c '
299
+ bash -c $ '
300
300
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
301
- cargo build --locked --target=x86_64-unknown-linux-musl --release
301
+
302
+ # Unit tests
303
+ cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
304
+ test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
305
+ mv "${test_bin}" target/unit_tests;
306
+
307
+ # Primary binary
308
+ cargo build --locked --target=x86_64-unknown-linux-musl --release;
309
+ mv target/x86_64-unknown-linux-musl/release/ui target/ui;
302
310
'
303
311
304
312
- name : " Restore permissions"
@@ -309,7 +317,9 @@ workflows:
309
317
uses : actions/upload-artifact@v2
310
318
with :
311
319
name : backend
312
- path : ui/target/x86_64-unknown-linux-musl/release/ui
320
+ path : |
321
+ ui/target/ui
322
+ ui/target/unit_tests
313
323
314
324
build_frontend :
315
325
name : " Build frontend"
@@ -413,6 +423,10 @@ workflows:
413
423
name : frontend
414
424
path : tests/server/build/
415
425
426
+ - name : " Run unit tests"
427
+ run : |-
428
+ chmod +x ./server/unit_tests && ./server/unit_tests
429
+
416
430
- name : " Run tests"
417
431
env :
418
432
PLAYGROUND_UI_ROOT : server/build/
Original file line number Diff line number Diff line change @@ -1634,7 +1634,7 @@ mod test {
1634
1634
let sb = Sandbox :: new ( ) . await . expect ( "Unable to create sandbox" ) ;
1635
1635
let resp = sb. execute ( & req) . await . expect ( "Unable to execute code" ) ;
1636
1636
1637
- assert ! ( resp. stderr. contains( "Killed" ) ) ;
1637
+ assert ! ( resp. stderr. contains( "Killed" ) , "was: {}" , resp . stderr ) ;
1638
1638
}
1639
1639
1640
1640
#[ tokio:: test]
@@ -1655,7 +1655,7 @@ mod test {
1655
1655
let sb = Sandbox :: new ( ) . await . expect ( "Unable to create sandbox" ) ;
1656
1656
let resp = sb. execute ( & req) . await . expect ( "Unable to execute code" ) ;
1657
1657
1658
- assert ! ( resp. stderr. contains( "Killed" ) ) ;
1658
+ assert ! ( resp. stderr. contains( "Killed" ) , "was: {}" , resp . stderr ) ;
1659
1659
}
1660
1660
1661
1661
#[ tokio:: test]
You can’t perform that action at this time.
0 commit comments