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

Add Postgres and database tests to CI #199

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

franciscodiazydiaz
Copy link
Contributor

📝 Summary

Update GitHub Action workflow Checks to fix the issue #168

⛱ Motivation and Context

Due to the Postgres dependency, the tests for the database code were skipped. This PR increments testing coverage by enabling the database tests (RUN_DB_TESTS=1).
The docker-compose definition is used to spin up the Postgres service while keeping non-required services down.

CI Before

ok  	github.com/flashbots/mev-boost-relay/database	0.050s	coverage: 0.0% of statements

CI After

ok  	github.com/flashbots/mev-boost-relay/database	0.143s	coverage: 10.1% of statements

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@codecov-commenter
Copy link

Codecov Report

Merging #199 (dee9356) into main (0ea94e6) will increase coverage by 1.48%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   20.68%   22.17%   +1.48%     
==========================================
  Files          19       19              
  Lines        2349     2349              
==========================================
+ Hits          486      521      +35     
+ Misses       1795     1757      -38     
- Partials       68       71       +3     
Flag Coverage Δ
unittests 22.17% <ø> (+1.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
database/database.go 10.17% <0.00%> (+10.17%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@metachris
Copy link
Collaborator

Thanks for the contribution!

Looks like it's working, and perhaps it's just fine like this. I wonder if https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers isn't how it's supposed to be done 🤔 But perhaps the current way is just fine

@metachris metachris merged commit 64a2a08 into flashbots:main Oct 17, 2022
@franciscodiazydiaz
Copy link
Contributor Author

Hey @metachris, thanks for the feedback. If you are still interested, I can give it a try at your recommendation.

@metachris
Copy link
Collaborator

metachris commented Oct 17, 2022

No strong opionions on this :)

Really happy we have db tests enabled now, thanks!

If you're curious, feel free to play with it, open to further suggestions. Btw, see also #200 for minor additional cleanup

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