Skip to content

Fix masked license validation tests - #5258

Open
w3lld1 wants to merge 2 commits into
aboutcode-org:developfrom
w3lld1:fix/unique-license-validation-tests
Open

Fix masked license validation tests#5258
w3lld1 wants to merge 2 commits into
aboutcode-org:developfrom
w3lld1:fix/unique-license-validation-tests

Conversation

@w3lld1

@w3lld1 w3lld1 commented Aug 3, 2026

Copy link
Copy Markdown

Summary

I renamed the two colliding license rule files so each generated validation test receives a distinct Python name. I also added a regression test that rejects future rule-file name collisions, and updated the contributor and changelog entries.

Validation

I ran:

  • PYTHONPATH=src pytest -q tests/licensedcode/test_rule_file_names.py
  • ruff check tests/licensedcode/test_rule_file_names.py
  • ruff format --check tests/licensedcode/test_rule_file_names.py
  • python -m py_compile tests/licensedcode/test_rule_file_names.py
  • git diff --check origin/develop...HEAD
  • A tracked-file check across all 36,482 rule files confirming that no generated Python names collide

I did not run the full 29,000+ test suite locally; I deferred it to CI because the focused regression and static checks cover the changed path.

Tasks

  • I reviewed the contribution guidelines
  • I linked the original issue
  • I used a uniquely named branch with one focused commit
  • I added a regression test
  • I updated CHANGELOG.rst
  • I updated AUTHORS.rst

Fixes #5257

w3lld1 added 2 commits August 3, 2026 02:15
Signed-off-by: w3lld1 <42353747+w3lld1@users.noreply.github.com>
Signed-off-by: w3lld1 <42353747+w3lld1@users.noreply.github.com>
@w3lld1

w3lld1 commented Aug 3, 2026

Copy link
Copy Markdown
Author

Fixed the license-data-sensitive CI failure in c0fa6d763 by updating the expected query spans after the rule-file renames changed the license index.

Fresh validation:

  • venv/bin/pytest -q tests/licensedcode/test_detect.py::TestMatchAccuracyWithFullIndex::test_match_has_correct_line_positions_in_automake_perl_file
  • venv/bin/pytest -q tests/licensedcode/test_rule_file_names.py
  • git diff --check

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.

Some license test files are masking each other

1 participant