Fix: Execute setup and teardown in clails test#142
Merged
tamurashingo merged 1 commit intodevelopfrom Jan 29, 2026
Merged
Conversation
- Added run-tests-with-setup-teardown helper function to properly execute suite-level setup and teardown hooks - Modified 3 locations in run-suite-tests to use the new helper function: - When packages are specified - When tags are specified - When running all tests - Added find-suite to rove imports Error handling: - If setup fails: skip tests for that package, execute teardown, return nil - If teardown fails: display error message, return test result Test verification: - Added setup/teardown to test/e2e/templates/todo-model-test.lisp - Confirmed that setup and teardown are executed correctly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed an issue where suite-level setup and teardown were not executed when running tests with the
clails testcommand.Problem
When executing the
clails testcommand, the following issues occurred:(setup ...)defined in test packages was not executed(teardown ...)defined in test packages was not executedCause
The
run-suite-testsfunction insrc/test/runner.lispwas passing a list of test symbols directly torove:run-tests.In rove, suite-level setup/teardown are executed within the
run-suite-testsmethod, but clails was callingrove:run-testsdirectly, so setup/teardown were not executed.Changes
1.
src/test/runner.lispAdded Helper Function
Added the
run-tests-with-setup-teardownfunction to execute the following process:Error Handling
When an error occurs in setup:
When an error occurs in teardown:
Application Points
Replaced
rove:run-testswithrun-tests-with-setup-teardownat 3 locations in therun-suite-testsfunction:Added Import
Added
find-suiteto the imports from therovepackage.2.
test/e2e/templates/todo-model-test.lispAdded setup/teardown test cases to e2e tests for verification:
Testing
Impact Scope
Target for Modification
run-suite-testsfunction insrc/test/runner.lispAffected Users
Related Issue
fix #141