Skip to content

Commit c6bdcb5

Browse files
committed
Run end-to-end tests
1 parent 534c41d commit c6bdcb5

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.github/workflows/pr.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,24 @@ jobs:
7777
e2e:
7878
name: e2e
7979
runs-on: "ubuntu-18.04"
80-
needs: build
81-
if: "false" # TODO
8280
steps:
8381
- uses: actions/checkout@v1
84-
- name: download jjs artifacts
85-
uses: actions/download-artifact@v1
86-
with:
87-
name: dist.tgz
88-
path: /opt/jjs
82+
- name: build
83+
run: cargo jjs-build --docker
8984
- name: launch jjs
9085
run: docker-compose up --detach
86+
- name: wait for launch
87+
run: cargo run --package util
88+
env:
89+
JJS_WAIT: tcp://localhost:1779
90+
RUST_LOG: util::wait=debug
9191
- name: run tests
9292
run: cargo jjs-test --integration-tests --skip-unit
9393
- name: collect logs
9494
if: always()
95-
run: docker-compose logs > logs.txt
95+
run: |
96+
docker-compose logs --tail=all
97+
docker-compose logs --tail=all > logs.txt
9698
- name: upload logs
9799
if: always()
98100
uses: actions/upload-artifact@v1

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ services:
1414
- "--sample-contest"
1515
- "--db-url=postgres://db:5432/jjs"
1616
- "--toolchains"
17-
- "--force"
1817
- "--touch=/var/jjs/done.txt"
1918
depends_on:
2019
- db

src/all/tests/judge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn submit(code: &str) -> i32 {
88
.operation(
99
r#"
1010
mutation Submit($runCode: String!) {
11-
submitSimple(toolchain: "cpp", problem: "A", runCode: $runCode, contest: "TODO") {
11+
submitSimple(toolchain: "g++", problem: "A", runCode: $runCode, contest: "TODO") {
1212
id
1313
}
1414
}

src/util/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use util;
2+
3+
fn main() {
4+
util::log::setup();
5+
println!(
6+
"wait spec: {}",
7+
std::env::var("JJS_WAIT").unwrap_or_default()
8+
);
9+
util::wait::wait();
10+
}

0 commit comments

Comments
 (0)