Skip to content

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

yoonieaj
Copy link
Contributor

@yoonieaj yoonieaj commented Jul 14, 2025

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.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests) x
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

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:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.
  • I have updated the project Changelog (this is required for all changes).

After opening your pull request:

  • I have verified that the CircleCI checks have passed.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls
Copy link

coveralls commented Jul 14, 2025

Pull Request Test Coverage Report for Build cb99c301-97ae-4969-a2ac-e00d0329ff8c

Details

  • 8 of 9 (88.89%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 50.747%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/Database/Database.hs 8 9 88.89%
Totals Coverage Status
Change from base Build b3da8d15-da8c-4295-b51f-1f6addb160ac: 0.01%
Covered Lines: 1772
Relevant Lines: 3551

💛 - Coveralls

@yoonieaj yoonieaj requested a review from david-yz-liu July 14, 2025 16:16
@yoonieaj yoonieaj marked this pull request as ready for review July 15, 2025 04:15
courseControllerTestSuite = testGroup "Course Controller tests" (runRetrieveCourseTests ++ runIndexTests ++ runCourseInfoTests)
test_courseController :: TestTree
test_courseController =
withResource (do acquireDatabase) releaseDatabase $ \_ ->
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

"modifier" should be singular

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