Skip to content

Fix --warnings-as-errors not catching misnamed test file warnings#15194

Merged
josevalim merged 5 commits intoelixir-lang:mainfrom
jdanielnd:fix-warnings-as-errors-misnamed-test-files
Mar 16, 2026
Merged

Fix --warnings-as-errors not catching misnamed test file warnings#15194
josevalim merged 5 commits intoelixir-lang:mainfrom
jdanielnd:fix-warnings-as-errors-misnamed-test-files

Conversation

@jdanielnd
Copy link
Contributor

Fixes two cases where misnamed test file warnings were not properly handled by --warnings-as-errors:

  • When tests fail, the exit status was not bumped by 1 for misnamed file warnings (warn_files was missing from the condition on the failures > 0 branch)
  • When no tests match the load filters (noop path), the --warnings-as-errors check was skipped entirely

Closes #15105

Cover two scenarios where misnamed test file warnings are not
properly handled by --warnings-as-errors:

- When tests fail, the exit status should be bumped by 1
- When no tests match (noop path), the abort message should be shown
Two cases were not properly handled:

- When tests fail, the exit status was not bumped by 1 for misnamed
  file warnings (warn_files was missing from the condition)
- When no tests match the load filters (noop path), the warnings-as-errors
  check was skipped entirely

Closes elixir-lang#15105
@josevalim
Copy link
Member

I believe the idea is that, if tests fail, that status code will have higher priority.

… file warnings

Remove the warn_files check from the failures > 0 branch and its
corresponding test, keeping only the noop path fix.
@jdanielnd
Copy link
Contributor Author

Makes sense, updated. Test failure exit status now takes priority. The fix only covers the noop path (when no test files match the load filters).

@jdanielnd jdanielnd requested a review from josevalim March 16, 2026 16:52
@josevalim josevalim merged commit a7b2d6c into elixir-lang:main Mar 16, 2026
15 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Misnamed test files are not counted as errors

2 participants