Skip to content

Commit 3e2e624

Browse files
feat(launcher): Add integration tests (IBM#9)
1 parent 32a2530 commit 3e2e624

File tree

6 files changed

+434
-14
lines changed

6 files changed

+434
-14
lines changed

.github/workflows/server-tests.yaml renamed to .github/workflows/tests.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
paths:
66
- "server/**"
77
- "proto/**"
8+
- "router/**"
9+
- "launcher/**"
810

911
jobs:
1012
run_tests:
@@ -15,16 +17,25 @@ jobs:
1517
uses: actions/setup-python@v1
1618
with:
1719
python-version: 3.9
20+
- name: Install Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: 1.65.0
24+
override: true
25+
components: rustfmt, clippy
1826
- name: Loading cache.
1927
uses: actions/cache@v2
2028
id: model_cache
2129
with:
2230
path: ~/.cache/huggingface/
2331
key: models
24-
- name: Install server dependencies
32+
- name: Install
2533
run: |
26-
make install-server
27-
- name: Run tests
34+
make install
35+
- name: Run server tests
2836
run: |
2937
pip install pytest
3038
pytest -sv server/tests
39+
- name: Run Rust tests
40+
run: |
41+
cargo test

Cargo.lock

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

launcher/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ description = "Text Generation Launcher"
77

88
[dependencies]
99
clap = { version = "4.0.15", features = ["derive", "env"] }
10-
ctrlc = "3.2.3"
10+
ctrlc = { version = "3.2.3", features = ["termination"] }
1111
subprocess = "0.2.9"
1212
tracing = "0.1.37"
1313
tracing-subscriber = { version = "0.3.16", features = ["json"] }
14+
15+
[dev-dependencies]
16+
float_eq = "1.0.1"
17+
reqwest = { version = "0.11.13", features = ["blocking", "json"] }
18+
serde = "1.0.150"
19+
serde_json = "1.0.89"

launcher/tests/bloom_560m.json

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
[
2+
{
3+
"details": {
4+
"finish_reason": "length",
5+
"generated_tokens": 20,
6+
"tokens": [
7+
[
8+
10264,
9+
"Test",
10+
null
11+
],
12+
[
13+
8821,
14+
" request",
15+
-11.895094
16+
],
17+
[
18+
17,
19+
".",
20+
-1.8267941
21+
],
22+
[
23+
1587,
24+
"get",
25+
-2.4674964
26+
],
27+
[
28+
11,
29+
"(",
30+
-1.9060438
31+
],
32+
[
33+
5,
34+
"\"",
35+
-1.2279553
36+
],
37+
[
38+
4899,
39+
"action",
40+
-4.170306
41+
],
42+
[
43+
5,
44+
"\"",
45+
-0.3247902
46+
],
47+
[
48+
12,
49+
")",
50+
-1.0773602
51+
],
52+
[
53+
30,
54+
";",
55+
-0.27640444
56+
],
57+
[
58+
837,
59+
"\n ",
60+
-1.6970599
61+
],
62+
[
63+
1320,
64+
" if",
65+
-1.4495552
66+
],
67+
[
68+
375,
69+
" (",
70+
-0.2360998
71+
],
72+
[
73+
4899,
74+
"action",
75+
-1.1916926
76+
],
77+
[
78+
3535,
79+
" ==",
80+
-0.8918663
81+
],
82+
[
83+
5109,
84+
" null",
85+
-0.39334255
86+
],
87+
[
88+
12,
89+
")",
90+
-0.4321134
91+
],
92+
[
93+
731,
94+
" {",
95+
-0.17701954
96+
],
97+
[
98+
1260,
99+
"\n ",
100+
-0.07027287
101+
],
102+
[
103+
10519,
104+
" throw",
105+
-1.3915133
106+
],
107+
[
108+
2084,
109+
" new",
110+
-0.042013377
111+
],
112+
[
113+
150858,
114+
" RuntimeException",
115+
-1.7330077
116+
]
117+
]
118+
},
119+
"generated_text": "Test request.get(\"action\");\n if (action == null) {\n throw new RuntimeException"
120+
}
121+
]

0 commit comments

Comments
 (0)