MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / run_cargo_tests

Function run_cargo_tests

scripts/test.py:43–102  ·  view source on GitHub ↗
(
    variants: List[Variant],
    features: Mapping[str, Sequence[str]] | None = None,
    target: str | None = None,
)

Source from the content-addressed store, hash-verified

41
42
43def run_cargo_tests(
44 variants: List[Variant],
45 features: Mapping[str, Sequence[str]] | None = None,
46 target: str | None = None,
47):
48 args = [cargo_cmd_name()]
49
50 args.extend(["build", "--tests", "--locked", "--workspace", "--exclude", DESKTOP_FUZZ_PACKAGE_NAME])
51
52 if target:
53 args.extend(["--target", target])
54
55 if Variant.FULL not in variants:
56 args.extend(["--exclude", DESKTOP_PACKAGE_NAME])
57
58 if features:
59 args.extend(
60 [
61 "--features",
62 ",".join(set(itertools.chain.from_iterable(features.values()))),
63 ]
64 )
65
66 run_cmd(
67 args,
68 env={
69 **os.environ,
70 **rust_env(release=False),
71 },
72 )
73
74 args = [cargo_cmd_name()]
75
76 # Run all lib, bin, and integration tests. Required to exclude running doc tests.
77 args.extend(
78 ["test", "--locked", "--workspace", "--lib", "--bins", "--test", "*", "--exclude", DESKTOP_FUZZ_PACKAGE_NAME]
79 )
80
81 if target:
82 args.extend(["--target", target])
83
84 # disable desktop tests for now
85 if isLinux():
86 args.extend(["--exclude", DESKTOP_PACKAGE_NAME])
87
88 if features:
89 args.extend(
90 [
91 "--features",
92 ",".join(set(itertools.chain.from_iterable(features.values()))),
93 ]
94 )
95
96 run_cmd(
97 args,
98 env={
99 **os.environ,
100 **rust_env(release=False),

Callers 1

all_testsFunction · 0.70

Calls 6

cargo_cmd_nameFunction · 0.90
run_cmdFunction · 0.90
rust_envFunction · 0.90
isLinuxFunction · 0.90
joinMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected