Skip to content

Handle bonus tests in run script#15

Merged
glennj merged 1 commit intoexercism:mainfrom
glennj:handle-bonus-tests
Apr 9, 2026
Merged

Handle bonus tests in run script#15
glennj merged 1 commit intoexercism:mainfrom
glennj:handle-bonus-tests

Conversation

@glennj
Copy link
Copy Markdown
Contributor

@glennj glennj commented Apr 9, 2026

Plus provide better error messages for assertions.

@glennj glennj requested a review from a team as a code owner April 9, 2026 14:54
Comment on lines +143 to +144
-- do not look for any tests after this line, they won't run in test environment
break if line\match '-- The next tests are optional.'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the main fix. Bonus tests reside below this marker. They are not run in the test runner, and the runner complains (down below on line 187) if the test output does not match the test bodies.

Comment on lines +187 to +190
if not test
status = 'error'
results.message = "missing test result for #{name}"
break
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That assertion was causing tests to error out with "An error occurred while running your tests.". I need to properly return the test results with a more appropriate message.

@glennj glennj merged commit 4701838 into exercism:main Apr 9, 2026
3 checks passed
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.

2 participants