Skip to content

Coverage#3034

Draft
comandeo-mongo wants to merge 16 commits intomongodb:masterfrom
comandeo-mongo:coverage
Draft

Coverage#3034
comandeo-mongo wants to merge 16 commits intomongodb:masterfrom
comandeo-mongo:coverage

Conversation

@comandeo-mongo
Copy link
Copy Markdown
Contributor

No description provided.

Other test functions unset TOPOLOGY and re-export it from
MLAUNCH_TOPOLOGY before invoking run-tests.sh, because the matrix axis
sets TOPOLOGY=replica_set (underscore) while spec/shared/shlib/server.sh
expects replica-set (hyphen). The new run coverage tests function was
missing this remap, causing "Unknown topology: replica_set" on
Evergreen.
run-tests.sh already launches MongoDB via mlaunch. Running
bootstrap-mongo-orchestration first started a second cluster on the
same ports, causing mlaunch to fail with "ports 27017/27018/27019 not
available". Other tasks like test-otel and test-csot only invoke their
run-tests function for the same reason.
run-tests.sh installs and activates rbenv inside its own subshell, so
the second shell.exec block had no bundle on PATH and exited 127. Add
the same two-line rbenv bootstrap that run-tests.sh uses; the toolchain
is already on disk and rbenv global is set, so this just makes it
visible to the second shell.
rake spec:ci runs ~9 sequential rspec processes via spec_organizer. With
SimpleCov.command_name set to a static 'rspec' in every process, each
bucket overwrote the previous one's session in coverage/.resultset.json
and only the last process's coverage survived. On Evergreen the last
bucket is connection-pool-stress, all of whose examples are pending, so
the resultset ended up with 0% coverage on every tracked file.

Make command_name unique per PID so each bucket stores a separate
session, and merge line hits across all sessions in CoverageGate.
SimpleCov's track_files placeholder uses a parser-based heuristic to
mark executable lines in files no process loaded. Ruby's Coverage
module is authoritative when the file was loaded. The previous merge
combined nil and 0 into 0, which inflated total by counting heuristic
"executable" lines that the real Coverage run had marked non-executable.
Switch to nil-wins so the authoritative classification overrides the
heuristic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant