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

ci(workflows): run go tests on PR, adapt tests #27

Merged
merged 5 commits into from
Dec 27, 2023
Merged

ci(workflows): run go tests on PR, adapt tests #27

merged 5 commits into from
Dec 27, 2023

Conversation

steebchen
Copy link
Member

@steebchen steebchen commented Dec 27, 2023

Adds go tests on push and PR

  • adapt existing tests, add concept of integration tests using integration build tag
  • unit tests depend on compose for now, can be refactored later
  • also run generate in a different job just to make sure that always works and doesn't break with any changes

@@ -1,4 +1,3 @@
// go:build test
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 was invalid anyway and it has to go into the test file

@@ -1,3 +1,5 @@
//go:build integration
Copy link
Member Author

Choose a reason for hiding this comment

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

integration tag for integration tests

@steebchen steebchen force-pushed the ci/test branch 4 times, most recently from 51de318 to 3dea917 Compare December 27, 2023 19:47
go-version: '1.21'

- name: Compose
run: docker compose up -d
Copy link
Member Author

@steebchen steebchen Dec 27, 2023

Choose a reason for hiding this comment

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

the generate task needs compose because sqlc needs an sql file which is generated by prisma migrate which needs a live db

@steebchen steebchen changed the title ci(workflows): add go test on push and PR, adapt tests ci(workflows): run go tests on push and PR, adapt tests Dec 27, 2023
@steebchen steebchen changed the title ci(workflows): run go tests on push and PR, adapt tests ci(workflows): run go tests on PR, adapt tests Dec 27, 2023
@steebchen steebchen merged commit 14e13fe into main Dec 27, 2023
6 checks passed
@steebchen steebchen deleted the ci/test branch December 27, 2023 20:06
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.

2 participants