Skip to content

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

Description

@DeusData

Summary

write_temp_file in tests/test_pipeline.c:9764-9776 creates only one directory level (/* mkdir -p (simple version, one level) */ → a single cbm_mkdir(parent)). A fixture that uses nested package directories — registry/batch/cronjob/strategy.go, the shape of most real Go/Java/C# layouts — silently writes nothing but the top-level files, the pipeline logs pipeline.discover files=1, and any precision assertion ("this edge must NOT exist") passes vacuously.

Why it matters

This bit a fixture while reproducing a cross-package call-resolution defect: the first version of the test passed on the unfixed tree because nothing had been indexed. A negative assertion over an empty graph is always green. The class of tests most at risk is exactly the class we are adding most of (false-positive CALLS edges, wrong-package bindings).

Proposed fix

  1. Make write_temp_file a real mkdir -p (iterate over every / in the relative path).
  2. Grep the suite for negative assertions (ASSERT_FALSE(... edge_exists ...), ASSERT_EQ(count, 0)) whose fixtures use nested paths and add a positive existence check first — the committed reproduction for the cross-package shape does this with a go_node_with_qn_tail_exists helper that asserts both same-named methods are Method nodes before asserting the absence of the edge.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edges

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions