atmos icon indicating copy to clipboard operation
atmos copied to clipboard

Add test-no-assertions and os-chdir-in-test rules

Open osterman opened this issue 4 months ago β€’ 5 comments

what

  • Introduced a new lint rule, test-no-assertions, to detect and flag test functions that contain only logging statements (t.Log, t.Logf) and no actual assertions (t.Error, t.Fatal, assert.*, require.*).
  • This rule also identifies and flags tests that unconditionally skip (e.g., direct t.Skip() calls or if true { t.Skip() }).
  • Added the os-chdir-in-test rule to the lintroller documentation, which was previously undocumented.

why

  • Preventing documentation-only tests: Tests that only log provide no value in terms of coverage or regression detection and can clutter the test suite. This rule ensures that tests actually verify behavior.
  • Preventing unconditionally skipped tests: Tests that always skip provide a false sense of security, consume CI resources without value, and can indicate forgotten work. This rule enforces that skips are conditional and meaningful.
  • Improving documentation: The os-chdir-in-test rule was added to the README to ensure all lintroller rules are properly documented.

references

  • closes # (No specific issue number provided in the context)

osterman avatar Oct 17 '25 20:10 osterman

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 66.75%. Comparing base (897d199) to head (cb03db0). :warning: Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1657   +/-   ##
=======================================
  Coverage   66.74%   66.75%           
=======================================
  Files         364      364           
  Lines       42499    42499           
=======================================
+ Hits        28365    28369    +4     
+ Misses      12045    12041    -4     
  Partials     2089     2089           
Flag Coverage Ξ”
unittests 66.75% <ΓΈ> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more. see 2 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 17 '25 20:10 codecov[bot]

πŸ’₯ This pull request now has conflicts. Could you fix it @osterman? πŸ™

mergify[bot] avatar Oct 17 '25 23:10 mergify[bot]

πŸ’₯ This pull request now has conflicts. Could you fix it @osterman? πŸ™

mergify[bot] avatar Oct 22 '25 03:10 mergify[bot]

Dependency Review

βœ… No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

github-actions[bot] avatar Oct 22 '25 14:10 github-actions[bot]

πŸ’₯ This pull request now has conflicts. Could you fix it @osterman? πŸ™

mergify[bot] avatar Oct 22 '25 15:10 mergify[bot]