11
11
import framework .utils as utils
12
12
13
13
SUCCESS_CODE = 0
14
+ MACHINE = platform .machine ()
15
+ TARGETS = ["{}-unknown-linux-gnu" .format (MACHINE ),
16
+ "{}-unknown-linux-musl" .format (MACHINE )]
14
17
15
18
16
19
@pytest .mark .timeout (120 )
17
20
@pytest .mark .skipif (
18
- platform . machine () != "x86_64" ,
21
+ MACHINE != "x86_64" ,
19
22
reason = "no need to test it on multiple platforms"
20
23
)
21
24
def test_rust_style ():
@@ -30,7 +33,7 @@ def test_rust_style():
30
33
31
34
@pytest .mark .timeout (120 )
32
35
@pytest .mark .skipif (
33
- platform . machine () != "x86_64" ,
36
+ MACHINE != "x86_64" ,
34
37
reason = "no need to test it on multiple platforms"
35
38
)
36
39
def test_python_style ():
@@ -66,14 +69,14 @@ def test_python_style():
66
69
])
67
70
68
71
69
- @pytest .mark .skipif (
70
- platform . machine () != "x86_64 " ,
71
- reason = "no need to test it on multiple platforms"
72
+ @pytest .mark .parametrize (
73
+ "target " ,
74
+ TARGETS
72
75
)
73
- def test_rust_clippy ():
76
+ def test_rust_clippy (target ):
74
77
"""Fails if clippy generates any error, warnings are ignored."""
75
78
utils .run_cmd (
76
- 'cargo clippy --all --profile test -- -D warnings' )
79
+ 'cargo clippy --target {} -- all --profile test -- -D warnings' . format ( target ) )
77
80
78
81
79
82
def check_swagger_style (yaml_spec ):
@@ -87,7 +90,7 @@ def check_swagger_style(yaml_spec):
87
90
88
91
89
92
@pytest .mark .skipif (
90
- platform . machine () != "x86_64" ,
93
+ MACHINE != "x86_64" ,
91
94
reason = "no need to test it on multiple platforms"
92
95
)
93
96
def test_firecracker_swagger ():
0 commit comments