Skip to content

Bump test runner to latest starter2024#71

Open
BNAndras wants to merge 6 commits intoexercism:mainfrom
BNAndras:upgrade-pyret-runner
Open

Bump test runner to latest starter2024#71
BNAndras wants to merge 6 commits intoexercism:mainfrom
BNAndras:upgrade-pyret-runner

Conversation

@BNAndras
Copy link
Member

misc-legacy-essentials2020 is the only new test. The rest are renamed for clarity following how I structured tests for the Arturo test runner.

In the Dockerfile, I patched out two large dependencies that wouldn't be needed for the current Exercism exercises. I should add more tests as part of this PR to make sure the test runner appropriately returns a helpful error message if a student tries to use something using those missing dependency and error out properly.

I also updated run.sh because I had a puzzling discrepancy emerged where my macOS host and the Docker image were both erroring out on the syntax error test for the right reason but with different diagnostic error messages. I should take a closer look at that.

@BNAndras BNAndras requested a review from a team as a code owner March 11, 2026 00:04
@BNAndras BNAndras mentioned this pull request Mar 11, 2026
@BNAndras
Copy link
Member Author

I'm also considering just removing the existing setup where the test runner iterates over functions containing the tests and conditionally calls them. I've had a few complaints that this system was too complex. On CPO, the check blocks are typically at the top level not inside functions and all would be run at the same time. I can add legacy tests ensuring the test runner won't regress for existing solutions and then remove this scaffolding completely.

bin/run.sh Outdated
sanitized_test_output=$(echo "${test_output}" | sed "s@${text_to_remove}@@g")
sanitized_test_output=$(echo "${sanitized_test_output}" | sed '/./,$!d; s/^[[:space:]]*//; s/\n/ /g')
# Punting on a diagnostic line discrepancy between macOS and Docker for syntax errors
sanitized_test_output=$(echo "${sanitized_test_output}" | sed -E '/^There were [0-9]+ potential parses\./d; /^Parse failed, next token is /d; /./,$!d; s/^[[:space:]]*//')
Copy link

Choose a reason for hiding this comment

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

Just for readability.

Suggested change
sanitized_test_output=$(echo "${sanitized_test_output}" | sed -E '/^There were [0-9]+ potential parses\./d; /^Parse failed, next token is /d; /./,$!d; s/^[[:space:]]*//')
sanitized_test_output=$(echo "${sanitized_test_output}" | sed -E '
/^There were [0-9]+ potential parses\./d
/^Parse failed, next token is /d
/./,$!d
s/^[[:space:]]*//
')

The third command, is that to delete leading blank lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that drops a leading empty line across the board.

Copy link
Member Author

Choose a reason for hiding this comment

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

The first pattern was what the Docker image was spitting out. The second pattern was what my Mac was spitting out. I think those could be their own sed section for clarity since they're only needed for the error syntax test. The others are the earlier patterns for deleting the leading blank lines as well as trimming whitespace. We still need those, but for all tests.

@BNAndras
Copy link
Member Author

I removed the TestRun setup as mentioned. This means I'll also need to PR changes to the testing docs as well as updating the context for all exercises to starter2024. Backwards compatibility is maintained through the additional misc-legacy-test-harness test I've added.

BNAndras and others added 3 commits March 16, 2026 23:40
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
sanitized_test_output=$(echo "${sanitized_test_output}" | sed '/./,$!d; s/^[[:space:]]*//; s/\n/ /g')
if [[ "${legacy_harness}" = false ]]; then
# Punting on a diagnostic line discrepancy between macOS and Docker for syntax errors
sanitized_test_output=$(echo "${sanitized_test_output}" | sed -E '
Copy link
Member

Choose a reason for hiding this comment

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

Note heredocs <<< are also an option here.

@BNAndras
Copy link
Member Author

It seems the test runner is in a good place. Thanks @glennj and @IsaacG. I'll need to queue up PRs this week for the Pyret track as well.

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.

3 participants