Skip to content

check-nondet silently passes in CI due to git grep running outside git repository #5220

@sisuresh

Description

@sisuresh

Problem

The src/test/check-nondet script uses git grep to detect non-deterministic patterns in source code, but it silently passes in CI without actually checking anything.

In CI, make check runs from the build directory (build-${CC}-${PROTOCOL}/), which is outside the git repository. All git grep commands fail with:

fatal: not a git repository (or any parent up to mount point /home/runner/work/stellar-core/stellar-core)

Since the script uses if git grep <pattern>; then exit 1; fi, a failing git grep (exit code 128) is falsy, so every check is skipped and the script exits 0 (PASS).

This allowed SecretKey::random() calls to be merged into test code in #5177 without being caught.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions