-
Notifications
You must be signed in to change notification settings - Fork 69
Add tasty-discover #1586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add tasty-discover #1586
Conversation
Pull Request Test Coverage Report for Build cb99c301-97ae-4969-a2ac-e00d0329ff8cDetails
💛 - Coveralls |
courseControllerTestSuite = testGroup "Course Controller tests" (runRetrieveCourseTests ++ runIndexTests ++ runCourseInfoTests) | ||
test_courseController :: TestTree | ||
test_courseController = | ||
withResource (do acquireDatabase) releaseDatabase $ \_ -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The do
is unnecessary; you can just use acquireDatabase
.
However, given that this code is going to be repeated across multiple test groups, I would refactor the withResource acquireDatabase releaseDatabase $ \_ -> ...
into a single function withDatabase
that takes a String
(label) and [TestTree]
(the test cases).
@@ -60,5 +60,7 @@ runIndexTests :: [TestTree] | |||
runIndexTests = map (\(label, graphs, expected) -> runIndexTest label graphs expected) indexTestCases | |||
|
|||
-- | Test suite for Graph Controller Module | |||
graphControllerTestSuite :: TestTree | |||
graphControllerTestSuite = testGroup "Graph Controller tests" runIndexTests | |||
test_graphControllers :: TestTree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test name should use "Controller", not "Controllers"
@@ -58,5 +58,5 @@ modandModOrTests :: TestTree | |||
modandModOrTests = createTest (stringifyModAnd globalFces) "ModAnd containing ModOrs" modandModOrInputs | |||
|
|||
-- functions for running tests in REPL | |||
modifierTestSuite :: TestTree | |||
modifierTestSuite = testGroup "ReqParser tests" [concatModOrTests, simpleModAndTests, modandModOrTests] | |||
test_modifiers :: TestTree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"modifier" should be singular
Proposed Changes
This PR updates the test suite to use
tasty-discover
. Test can now be automatically found by the compiler and the test tree structure/hierarchy does not need to be manually built, and some test files can be removed....
Screenshots of your changes (if applicable)
Type of Change
(Write an
X
or a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]
into a[x]
in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)