Skip to content

fix(tests): create nested pipeline fixtures reliably - #2073

Open
astandrik wants to merge 5 commits into
DeusData:mainfrom
astandrik:astandrik/fix-issue-2034
Open

astandrik wants to merge 5 commits into
DeusData:mainfrom
astandrik:astandrik/fix-issue-2034

Conversation

@astandrik

@astandrik astandrik commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

The pipeline test writer only created the immediate parent directory, so fixtures with multiple missing directory levels could silently disappear. Use cbm_mkdir_p and require the expected source nodes before negative edge checks.

Add regressions for exact file contents, nested Go indexing, a regular file blocking directory creation, and exact node counting. Cover deep paths, Unicode, overwrites, and 1023/1024/1025-byte boundaries; make envscan and pkgmap rely on the writer for nested directories.

Verification

The final commit aec9bfe3 changes only fixture comments; executable text and line counts are unchanged. The completed CI results below are from 8e29e156; checks on the latest commit are shown in GitHub.

  • Verified source 8e29e156 CI: all 137 suites per platform passed — Linux x64/ARM64 7,792 each, macOS Intel/ARM64 7,788 each, Windows x64 7,667; 0 failed. All ten shard manifests and totals were audited. ci-ok, lint and the existing sanitizer jobs also passed.
  • Native Windows ARM64: full scripts/test.sh CC=clang CXX=clang++, 141 suites, 7,833 passed, 0 failed, 69 platform skips. Native ARM64 binary, trap-UBSan flags, unchanged source and every suite log verified.
  • On the original fix 5abd77f5: RED/GREEN for directory creation and exact contents; 15 controls passed; all 32 mutations failed at the intended assertions. Full macOS/Linux tests and CI lint passed; known baseline diagnostics are listed below. The fix's added/deleted lines are identical after the main merge.
  • Cases include depth 0/1/2/3/8, existing/partial parents, spaces/Unicode, 480-byte paths, empty files, line endings, overwrites, blocked parents, and 1023/1024/1025-byte boundaries with extra/truncated/changed contents.

Known unrelated issues: local Linux reports six UBSan diagnostic lines reproduced without the patch; full clang-tidy reports 6,754 diagnostics in unchanged files. The fixed Windows comparison completed 22 attempts: the same cold-storm endpoint failure occurred 2/11 on base and 2/11 on candidate, with no timeouts or precondition skips. That auxiliary job remains red; its strict cleanliness check also flagged only generated graph-ui/tsconfig.tsbuildinfo in both builds. C/guard source hashes remained unchanged. The upstream Windows guard passed on 8e29e156.

Fixes #2034

Checklist

  • Every commit is signed off (git commit -s).
  • Canonical tests pass locally; sanitizer limitations are disclosed above.
  • CI lint (scripts/lint.sh --ci) and the memory analyzer pass locally.
  • New behavior has reproduce-first regressions and mutation checks.

Create missing parent directories recursively and require fixture nodes before
negative graph assertions. Cover exact bytes, deep paths and blocked parents.

Fixes DeusData#2034

Signed-off-by: astandrik <astandrik@yandex-team.ru>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

Merge upstream main at aa44c28 into the issue DeusData#2034 branch. Preserve the existing one-file fixture patch and validate the merged pipeline suites and CI lint entrypoint.

Signed-off-by: astandrik <astandrik@yandex-team.ru>
Signed-off-by: astandrik <astandrik@yandex-team.ru>
@astandrik
astandrik marked this pull request as ready for review September 7, 2026 14:21
@astandrik
astandrik requested a review from DeusData as a code owner September 7, 2026 14:21
Copilot AI lite review requested due to automatic review settings September 7, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is test-only, addresses a clear correctness gap (nested fixture directories), and adds targeted regressions that make failures non-vacuous.

Pull request overview

This PR hardens the pipeline test fixture writer so it reliably creates deeply nested fixture directories, and it adds anti-vacuous guards to negative graph assertions by requiring the expected source nodes to exist first.

Changes:

  • Switch write_temp_file from single-level directory creation to recursive cbm_mkdir_p for nested fixture paths.
  • Add fixture_node_count and fixture_file_matches helpers and use them to assert fixture presence/contents before negative edge checks.
  • Add regression tests covering deep paths (including Unicode), overwrite behavior, blocked parent paths, byte-boundary exactness (1023/1024/1025), and nested Go indexing endpoints.
File summaries
File Description
tests/test_pipeline.c Makes fixture writing recursive, adds helpers to validate fixtures and node presence, and introduces regressions to prevent vacuous negative assertions with nested fixtures.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@DeusData DeusData added bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Sep 9, 2026
@DeusData

DeusData commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Thank you for the focused nested-fixture fix in tests/test_pipeline.c. This is queued for review, and we need a little more time to check the fixture lifecycle and failure handling before giving a decision.

The review queue is currently full, so detailed feedback may take a little time. We are working through it carefully and appreciate the work you have put into supporting the project. Thank you for your patience.

@DeusData

Copy link
Copy Markdown
Owner

Here is the review this was queued for on 2026-09-09. Eleven days is too long for a test-only change, and I am sorry — you were told it was waiting on us, and then it kept waiting.

The verdict: this is better than its title, and I want to be specific about why.

The headline is reliable nested fixtures, and cbm_mkdir(parent) → cbm_mkdir_p(parent, 0755) does fix that — the old comment cheerfully admitted it was a "simple version, one level", which is a bug waiting for the first two-level fixture path. But the more valuable half of this diff is the assertion hardening, and it addresses a failure mode this repository keeps getting bitten by.

count_nodes_named(s, project, "err") >= 1 is not a test. It passes if any node anywhere in the graph happens to be called err, in any file, with any label. It would keep passing if the node it was actually written to check disappeared entirely, as long as some unrelated err survived. Replacing it with

fixture_node_count(s, project, "state/state.go", "err", "Field") >= 1

pins the file path and the label, so the assertion can only be satisfied by the thing it is about. That is the difference between a test and a green light.

And you found an inert fixture. This one is the part I would not have caught by reading:

-  int event = 0;          /* block-local */
+  static int event = 0;   /* file scope */

Block-local C variables are not emitted as nodes, so the cross-language collision guard — the whole point of that probe — had nothing to collide with. The test was passing because it was checking nothing. A verified-broken fixture getting fixed rather than deleted or worked around is exactly the right call.

Verified rather than assumed. I built your head and ran the suite you touch: 280 pipeline tests, 0 failures. Your strengthened assertions hold against what production actually emits, which is the thing that could have gone wrong when you tightened them.

The test-lsan-macos red is not yours. It fails at tests/test_convergence_probe.c:636 ASSERT(grpc >= 1) — a different test file from the only file you touch. I ran that suite three times locally and it passed each time, so it does not reproduce here; I have re-run the CI job against your identical commit to confirm it is nondeterministic rather than real. I am not treating a green rerun as the end of it either — a required check that passes on retry is a defect of ours to attribute, not something to shrug past — but it will not block you.

Once that check settles I will merge this. Thank you for the patience, and for tightening assertions that were quietly protecting nothing.

@DeusData

DeusData commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Thank you, @astandrik, and sorry again for how long the review took. The real value here is the assertion hardening. count_nodes_named(project, err) >= 1 used to pass for any node named err anywhere, and the fixture helpers now pin path and label exactly, so these pipeline tests can no longer pass by accident. We built and tested this against main (pipeline 293 passed, all 4 new tests green).

Correction: an earlier version of this comment said "Merged". That was wrong, sorry. #2288 landed a moment before and touched the same spot in tests/test_pipeline.c, so this branch now has a small conflict. We'll resolve it on our side (keeping both sets of tests), re-verify, and merge. Nothing is needed from you.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>

# Conflicts:
#	tests/test_pipeline.c
@DeusData

Copy link
Copy Markdown
Owner

@astandrik, the conflict is resolved: we merged main into your branch (9130fab), keeping your four tests and #2288's new one side by side. pipeline passes locally (294 tests), and it merges as soon as CI is green on the new head. Nothing is needed from you. Thanks again!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: write_temp_file creates only one directory level — nested-package fixtures index nothing and negative assertions pass vacuously

3 participants