Skip to content
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

refactor: Create primer-testlib and primer-rel8-testlib packages. #758

Merged
merged 8 commits into from
Nov 3, 2022

Conversation

dhess
Copy link
Member

@dhess dhess commented Nov 2, 2022

Fixes #273.

@dhess dhess force-pushed the dhess/testlib branch 3 times, most recently from 1dc9ad3 to 3d3993f Compare November 2, 2022 16:35
@dhess dhess changed the title refactor: Create a new primer-testlib package. refactor: Create primer-testlib and primer-rel8-testlib packages. Nov 2, 2022
dhess added 7 commits November 2, 2022 16:36
We have numerous testing-related utility functions that are repeated
in multiple packages' test suites. This "testlib" package will help us
keep them in one place.

Note that this commit simply creates the new library and uses it in
the `primer` test suite; it is not yet used in the `primer-rel8` or
`primer-service` test suites.
This does for `primer-rel8` testing what `primer-testlib` did for
`primer` testing.
@dhess
Copy link
Member Author

dhess commented Nov 2, 2022

This wasn't urgent work, but I'm about to start initial work on benchmarks, and I figured it was likely we'd end up with the same sorts of DRY issues for benchmarking as we have for tests, so might as well do this first.

@dhess dhess requested a review from a team November 2, 2022 16:40
Comment on lines +35 to +36
comprehensive :: App
comprehensive =
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this comprehensive differ from Primer.Examples.comprehensive?

Copy link
Member Author

Choose a reason for hiding this comment

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

This one is an App, the other is a MonadFresh ID m => ModuleName -> m (GVarName, Def)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yes, I see. This one wraps the Examples one in an App

Comment on lines -168 to -170
--
-- Note: we should DRY this, see:
-- https://github.com/hackworthltd/primer/issues/273
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused, we haven't actually DRYed anything, just moved code...

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, we do that in the next commit

Copy link
Member Author

Choose a reason for hiding this comment

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

There were previously 2 copies of this action.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I was confused since in the commit where we remove this comment we don't dry, but we do in the very next commit. (And I was looking at the pr commit-by-commit)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, yes, I jumped the gun a bit by removing the comment in the first commit.

@dhess
Copy link
Member Author

dhess commented Nov 2, 2022

Ugh, weeder strikes again. I will fix the CI failure by refactoring the withDbSetup helper; I was a bit lazy not doing that the first time around.

(edit Sorry for doubting you, weeder: you were actually doing your job and there was some dead code lying around in one of the tests.)

@dhess dhess added this pull request to the merge queue Nov 3, 2022
Merged via the queue into main with commit 9a77503 Nov 3, 2022
@dhess dhess deleted the dhess/testlib branch November 3, 2022 13:00
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.

Create and export a test library for primer and primer-rel8
2 participants