Regression tests ensure continued support for operations required by your frontend apps or users i.e. validating changes to the GraphQL schema (schema integrity) against these operations to ensure that there are no breaking changes or regressions in your GraphQL API.
Your production instance should typically be configured to run regression test suites since changes to the underlying Postgres schema and/or the Hasura configuration could potentially lead to unwanted regressions in your schema. This is crucial for iterating on new features or removing existing features.
Create a test suite
On Hasura Cloud console, under the Pro/Monitoring tab, head to
Regresstion Tests at the end. Select the actions that are typically accessed from the frontend client. In our slack model, we would want to add both users and channel query that we have tried so far. Click on
Add to test suite. Once this is added, we can now make a schema change to verify if a regression has been caught.
Open the Hasura Console via the CLI. (
http://localhost:9695). Now let's make a schema change to the channel table to rename the
name column to
Then run the test suite through the
Run Tests tab. The channel query should now fail.
With the following error
field "name" not found in type: 'channel'.
This kind of tests ensure that breaking changes are not pushed to production without the relevant updates to the client.
Note: We can select the test suite from any other cloud project to run on the current project. This is useful when the test suite configured on production instance works on the staging environment post the schema change.
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs