-
Notifications
You must be signed in to change notification settings - Fork 59
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: PR workflow integration tests #89
base: main
Are you sure you want to change the base?
Ci: PR workflow integration tests #89
Conversation
52345db
to
671e7c4
Compare
05ea7b3
to
cbd2fee
Compare
__tests__/e2e/species.spec.ts
Outdated
import examplePlanter from '@mocks/planters/examplePlanter.json'; | ||
import exampleSpecies from '@mocks/species/exampleSpecies.json'; |
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.
@QuaidBartolomei what's this interesting thing about?
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.
I need to seed data into the db that is being created in the new pr workflow. The existing json objects are outdated and unable to be inserted so I created some new ones. The @mocks/
path is a path alias I added to jest.config.js so I don't have to use the relative paths
3af73eb
to
df39f6a
Compare
test(mock): update mock tree data
test(seed): wallet data
test(planter): skip test of bugged route
6f0e15b
to
479a15d
Compare
This PR will enhance our PR github action workflow by including integration tests. In order to run the tests a new database needs to be created each time. This is accomplished by using the docker postgis image and running sql code to create the schemas and tables. Then the empty tables need to be seeded with the necessary test data.
Database seeding conditionally occurs in
.jest/globalSetup.ts
ifprocess.env.SEED === 'true'
I had to mark a few tests for skipping because they would not pass with the seed data:
trees/featured
,countries/leaderboard
: These routes currently only have placeholder/mock implementations. The tests will need to be changed once the routes are complete so it was not worth it for me to spend time creating seed data for them.planters?organization_id=1&limit=1
: This route is currently bugged and the existing test is passing because of a false positive #93tsconfig-paths was added as a dev dep so that .jest/globalConfig can use the path alias defined in tsconfig.base.ts.