Skip to content

test: Refresh stale test fixtures OD-497 - #207

Merged
pedrobpereira merged 0 commit into
feat/project-token-config-OD-497from
fix/stale-test-fixtures
Aug 18, 2026
Merged

test: Refresh stale test fixtures OD-497#207
pedrobpereira merged 0 commit into
feat/project-token-config-OD-497from
fix/stale-test-fixtures

Conversation

@pedrobpereira

Copy link
Copy Markdown
Contributor

Changes

  • tools/lizard/test/lizard.yaml (new): pins the Lizard pattern set for the SARIF unit test. Without it the test fetched default patterns from the live API, so any upstream pattern change broke it. expected.sarif is unchanged.
  • integration-tests/{init-without-token,config-discover}/expected/tools-configs/*: regenerated against the current API — trivy's file list gained go.sum, Lizard's patterns were renamed and re-levelled (ccn-mediumccn-minor), and the opengrep/pmd/pylint/revive rule sets moved.
  • plugins/tools/trivy/test/expected.sarif: regenerated — new CVEs in the Trivy DB added rules and shifted every ruleIndex.

None of these are behaviour changes; the fixtures were last touched in March and the data behind them has moved since. main fails the same way today.

Known remaining rot

plugins/tools/trivy/test/expected.sarif is compared against a vulnerability DB that updates daily, so this refresh buys days, not months. The opengrep tool test also failed CI on a connection reset by peer while paginating patterns from app.codacy.com — a flake, not a fixture problem, but it shows how much of this suite depends on live network data. Both want a real fix (pinned DB / assert on a subset), tracked separately.

Manual Testing

@codacy-production

codacy-production Bot commented Aug 18, 2026

Copy link
Copy Markdown

Not up to standards ⛔

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@pedrobpereira
pedrobpereira marked this pull request as ready for review August 18, 2026 15:03
@pedrobpereira
pedrobpereira changed the base branch from main to feat/project-token-config-OD-497 August 18, 2026 15:04
@pedrobpereira
pedrobpereira force-pushed the fix/stale-test-fixtures branch from 8674f67 to 2713816 Compare August 18, 2026 15:04

@codacy-production codacy-production Bot 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.

Pull Request Overview

This PR successfully refreshes test fixtures for Trivy, Lizard, PMD, and Semgrep while pinning Lizard patterns to reduce external API dependencies. Codacy analysis indicates the changes are up to standards with no coverage regressions.

However, a recurring inconsistency was found in the Lizard configuration files where the rule explanations still reference a threshold of 5, despite the logic being updated to 8. Additionally, the Trivy integration tests remain brittle due to their reliance on a live, daily-updating vulnerability database. There are also reported flakes related to network dependencies during OpenGrep pagination that should be monitored.

About this PR

  • Systemic inconsistency: Across updated lizard.yaml files, rule explanations for 'parameter-count-medium' still cite a threshold of 5, while the configuration and descriptions have been updated to 8.
  • The 'Manual Testing' section in the PR description is incomplete (currently a TODO). Ensure testing is documented or the section is updated before merging.

Test suggestions

  • SARIF unit tests for Lizard use a pinned pattern set to avoid dependency on the live Codacy API.
  • Tool configuration discovery for Trivy correctly identifies 'go.sum' as a relevant file.
  • PMD ruleset generation supports the PMD 7 schema and category-based rule references.
  • Trivy integration tests pass with the latest vulnerability database entries.
Low confidence findings
  • Note that Trivy SARIF fixtures and OpenGrep pagination remain dependent on live databases and network connections, which may cause brittle tests or intermittent CI failures.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Lizard_parameter-count-medium:
category: Complexity
description: This rule checks the number of parameters passed to a function and raises an issue if it exceeds a medium threshold, which by default is 8 parameters.
description: Reports a Medium issue when a function's parameter count reaches the configured threshold, which defaults to 8. A signature this wide is hard to call correctly and usually signals that the function has taken on too many responsibilities.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

The rule description specifies a default threshold of 8, but the explanation (visible in the surrounding context) still incorrectly references 5. Update the explanation to match the threshold and adopt the 'exceeded' terminology used in the updated Lizard_ccn-minor rule.

warningCode = 0

rules = ["blank-imports", "context-as-argument", "context-keys-type", "dot-imports", "empty-block", "error-naming", "error-return", "error-strings", "errorf", "exported", "increment-decrement", "indent-error-flow", "package-comments", "range", "receiver-naming", "redefines-builtin-id", "superfluous-else", "time-naming", "unexported-return", "unreachable-code", "unused-parameter", "var-declaration", "var-naming"]
rules = ["blank-imports", "context-as-argument", "context-keys-type", "dot-imports", "empty-block", "errorf", "error-naming", "error-return", "error-strings", "exported", "increment-decrement", "indent-error-flow", "package-comments", "range", "receiver-naming", "redefines-builtin-id", "superfluous-else", "time-naming", "unexported-return", "unreachable-code", "unused-parameter", "var-declaration", "var-naming"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW RISK

Nitpick: The errorf rule is out of alphabetical order. It should follow the error- prefixed rules (error-naming, error-return, error-strings) to maintain consistent sorting.

@pedrobpereira
pedrobpereira force-pushed the fix/stale-test-fixtures branch from 2713816 to 77e2459 Compare August 18, 2026 15:12
@pedrobpereira
pedrobpereira merged commit 77e2459 into main Aug 18, 2026
2 checks passed
@pedrobpereira
pedrobpereira deleted the fix/stale-test-fixtures branch August 18, 2026 15:12
@pedrobpereira
pedrobpereira restored the fix/stale-test-fixtures branch August 18, 2026 15:14
@pedrobpereira
pedrobpereira deleted the fix/stale-test-fixtures branch August 18, 2026 15:34
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