Skip to content

test: isolate ozone test directories - #3396

Open
setchy wants to merge 1 commit into
mainfrom
test/sonar-ozone-isolation
Open

setchy wants to merge 1 commit into
mainfrom
test/sonar-ozone-isolation

Conversation

@setchy

@setchy setchy commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the shared /tmp/gitify-test-userdata path with a unique fs.mkdtempSync directory under os.tmpdir() for each test.
  • Point the Electron userData mock at that test's directory and derive its marker path from the same location.
  • Restore spies/platform state and remove only the directory created for that test during teardown, avoiding shared marker files and leftover directories.

Addresses the two sonarjs/publicly-writable-directories findings from the one-off test-code scan while improving test isolation. Only src/main/ozone.test.ts changes; no production Ozone behavior, dependencies, or configuration changes.

Validation

  • Focused Ozone suite: 9 tests passed.
  • Full suite: 1,865 tests passed across 186 files.
  • TypeScript, formatting/lint checks, and production build passed. The build emitted a non-fatal chunk-size warning.
  • Type-aware SonarJS recommended-rule scan of the changed file: zero findings and zero parsing errors. This is a local ESLint-plugin result, not a claim about SonarCloud issue closure.

@setchy
setchy requested a review from afonsojramos as a code owner October 8, 2026 23:58
@github-actions github-actions Bot added the test Enhancements to test coverage or quality label Oct 8, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

test Enhancements to test coverage or quality

Development

Successfully merging this pull request may close these issues.

1 participant