Excluded files being included in scans

Hi all,

We’re currently using SonarQube Cloud integrated with Github PR’s. We have a few file exclusion patterns set up, notably ones to remove test files from analysis.

  • tests/**/*
  • **/*.spec.ts
  • **/*.spec.tsx

These exclusions were working fine up until yesterday. We’ve started having scans fail on files that match these patterns. For instance: ‎tests/e2e-tests/fixtures/page-objects/page-objects-fixture.ts

Additionally, the analysis fails around code that didn’t even change in the PR’s. I’ve tried adding a few other patterns (tests/**, tests/*, tests/**/*.ts) in hopes that either resaving would trigger it to work again or maybe the pattern matching changed. But that doesn’t seem to have fixed the problem.

Did something change on SonarQube Cloud’s end? Are we doing something wrong on our end?

Thanks!

Hi,

Can you share the analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann

Ann, thanks for your reply! We actually discovered this morning that the property sonar.exclusionswas added to a sonar-project.propertiesfile in the repo being scanned. The value set in here ended up overriding the UI settings. Once we included the test files in that property, the scans started functioning properly again. Hopefully this helps anybody else that encounters a similar problem.

Thanks again!