File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191 test "$("$binary" --version)" = "sno $version"
9292 help="$($binary --help)"
9393 for command in account station starport; do
94- rg -q "^[[:space:]]+$command" <<<"$help"
94+ grep -Eq "^[[:space:]]+$command([[:space:]]|$) " <<<"$help"
9595 done
9696 profile="$(mktemp -d)"
9797 test "$(SNO_PROFILE_DIR="$profile" "$binary" station telemetry consent get --json)" = '{"consent":"metadata-only"}'
@@ -154,7 +154,7 @@ jobs:
154154 test "$(docker run --rm --pull=always -v "$binary:/sno:ro" "$image" /sno --version)" = "sno $version"
155155 help="$(docker run --rm -v "$binary:/sno:ro" "$image" /sno --help)"
156156 for command in account station starport; do
157- rg -q "^[[:space:]]+$command" <<<"$help"
157+ grep -Eq "^[[:space:]]+$command([[:space:]]|$) " <<<"$help"
158158 done
159159 output="$(docker run --rm -v "$binary:/sno:ro" -v "$profile:/profile" -e SNO_PROFILE_DIR=/profile "$image" /sno station telemetry consent get --json)"
160160 test "$output" = '{"consent":"metadata-only"}'
Original file line number Diff line number Diff line change 2424 " vi\\ .mock\\ s*\\ (" ,
2525 " mockery\\ .patch" ,
2626 " monkeypatch\\ ." ,
27- " (?<![ A-Za-z0-9_])patch\\ s*\\ (" ,
27+ " (^|[^ A-Za-z0-9_])patch\\ s*\\ (" ,
2828 " (struct|class)\\ s+(Fake|Mock)(FileSystem|Filesystem|Database|Db|Process|Command|Service)" ,
2929 " (Fake|Mock)(FileSystem|Filesystem|Database|Db|Process|Command|Service)\\ s*[({]" ,
3030 " InMemory(FileSystem|Filesystem|Database|Db|Process)"
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ source_pattern="$(jq -r '.banned_source_patterns | join("|")' "$policy")"
3737server_pattern=" $( jq -r ' .service_server_patterns | join("|")' " $policy " ) "
3838
3939mapfile -t manifests < <( printf ' %s\n' " ${files[@]} " | rg ' /(Cargo\.toml|package\.json|pyproject\.toml)$' || true)
40- if [[ " ${# manifests[@]} " -gt 0 ]] && rg -n -i --pcre2 " (^|[^A-Za-z0-9_-])($dependency_pattern )([^A-Za-z0-9_-]|$)" " ${manifests[@]} " ; then
40+ if [[ " ${# manifests[@]} " -gt 0 ]] && rg -n -i " (^|[^A-Za-z0-9_-])($dependency_pattern )([^A-Za-z0-9_-]|$)" " ${manifests[@]} " ; then
4141 fail " forbidden mocking dependency detected"
4242fi
4343
44- if rg -n --pcre2 " $source_pattern " " ${files[@]} " ; then
44+ if rg -n " $source_pattern " " ${files[@]} " ; then
4545 fail " forbidden internal mock or monkey-patch detected"
4646fi
4747
@@ -52,7 +52,7 @@ while IFS= read -r server_file; do
5252 printf ' %s\n' " $relative " >&2
5353 fail " undeclared service replacement detected"
5454 }
55- done < <( rg -l --pcre2 " $server_pattern " " ${files[@]} " || true)
55+ done < <( rg -l " $server_pattern " " ${files[@]} " || true)
5656
5757while IFS= read -r allowed_path; do
5858 [[ -n " $allowed_path " ]] || continue
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ printf '[package]\nname = "seed"\nversion = "0.0.0"\n' >"$tmp_dir/colocated/Carg
3131printf ' #[cfg(test)] mod tests { mock!(InternalService {}); }\n' > " $tmp_dir /colocated/src/lib.rs"
3232expect_failure colocated
3333
34+ mkdir -p " $tmp_dir /patch/tests"
35+ printf ' [package]\nname = "seed"\nversion = "0.0.0"\n' > " $tmp_dir /patch/Cargo.toml"
36+ printf ' patch("module.internal");\n' > " $tmp_dir /patch/tests/internal.py"
37+ expect_failure patch
38+
3439for kind in filesystem database process; do
3540 mkdir -p " $tmp_dir /fake-$kind /src"
3641 printf ' [package]\nname = "seed"\nversion = "0.0.0"\n' > " $tmp_dir /fake-$kind /Cargo.toml"
@@ -58,4 +63,4 @@ printf 'let listener = TcpListener::bind("127.0.0.1:0");\n' >"$tmp_dir/allowed/t
5863" $checker " " $tmp_dir /allowed" " $policy " > /dev/null
5964
6065" $checker " " $repo_root " " $policy " > /dev/null
61- printf ' test-substitute policy self-test passed: 8 forbidden mutations rejected, allowlist and repository accepted\n'
66+ printf ' test-substitute policy self-test passed: 9 forbidden mutations rejected, allowlist and repository accepted\n'
Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ impl SnoServiceServer {
5757 Err ( error) => panic ! ( "accept request: {error}" ) ,
5858 }
5959 } ;
60+ stream
61+ . set_nonblocking ( false )
62+ . expect ( "set request stream blocking" ) ;
6063 stream
6164 . set_read_timeout ( Some ( Duration :: from_secs ( 2 ) ) )
6265 . expect ( "set request timeout" ) ;
You can’t perform that action at this time.
0 commit comments