Skip to content

Conversation

@QuaidBartolomei
Copy link
Contributor

@QuaidBartolomei QuaidBartolomei commented Feb 25, 2022

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 if process.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 #93

tsconfig-paths was added as a dev dep so that .jest/globalConfig can use the path alias defined in tsconfig.base.ts.

@QuaidBartolomei QuaidBartolomei force-pushed the ci/pr-workflow-integration-tests branch 14 times, most recently from 52345db to 671e7c4 Compare March 1, 2022 08:31
@QuaidBartolomei QuaidBartolomei force-pushed the ci/pr-workflow-integration-tests branch from 05ea7b3 to cbd2fee Compare March 1, 2022 09:20
Comment on lines 2 to 3
import examplePlanter from '@mocks/planters/examplePlanter.json';
import exampleSpecies from '@mocks/species/exampleSpecies.json';
Copy link
Contributor

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?

Copy link
Contributor Author

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

@QuaidBartolomei QuaidBartolomei force-pushed the ci/pr-workflow-integration-tests branch from 3af73eb to df39f6a Compare March 6, 2022 00:48
@QuaidBartolomei QuaidBartolomei force-pushed the ci/pr-workflow-integration-tests branch from 6f0e15b to 479a15d Compare March 6, 2022 01:07
@QuaidBartolomei QuaidBartolomei changed the title Ci/pr workflow integration tests Ci: PR workflow integration tests Mar 6, 2022
@QuaidBartolomei QuaidBartolomei marked this pull request as ready for review March 6, 2022 01:11
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