This project includes Infisical's Checkly test suite to verify API responses against gamma.
Tests are located within the __checks__ folder, and group with their respective resource. For example the secrets folder contains all the checks associated with endpoints pertaining to the secrets resource.
Within each resource folder a group-check file is present to associate all checks within this resource into a single collection within Checkly. In addition, a sub-folder for each endpoint operation is available; co-locating all the associated files for running this check. Each operation includes the following files:
- v[#].check.ts - the actual check file to be run against the API endpoint, indicating which endpoint version for this operation is being tested
- setup.ts (optional) - an optional script to setup any resources required to test this API endpoint
- teardown.ts (optional) - an optional script to teardown any resources created during this check
- seed.ts (optional) - an optional file containing any seed data that needs to be referenced during the checks execution
secrets/
├── create/
├── delete/
├── list/
├── update/
│ ├── seed.ts
│ ├── setup.ts
│ ├── teardown.ts
│ └── v3.check.ts
└── secrets-group.ts
In addition, a helpers folder is located within the checks folder that contains commonly used setup and teardown functions used across checks.
- Install dependencies using
npm install
. - Run a tunnel to your local infisical instance using
ngrok
or tunneler of choice. - Create a machine identity in your local infisical instance and generate a client secret.
- Create a
.env
file at the root of your project and populate it with your tunnel URL and identity credentials. - Log in to your Checkly account using
npx checkly login
- Verify your setup by running
npx checkly test --env-file="./.env"
and making sure the checks successfully run - Add new tests following the project structure.
- You can run individual tests by appending the test name to the above command.
- You can specify a run location using the
--location
flag. - You can dry run your tests against gamma using the
--private-location
flag by setting up a private location and running the docker agent on your machine provided you're running twingate. - Use the
--verbose
flag for more detailed insights into running checks.
- Verify new tests are passing locally.
- Running new tests against gamma from your machine is encouraged.
- Create a PR for your changes.
- A workflow will be triggered and dry-run all tests against gamma.
- If the dry-run passes successfully, your PR can be merged into
main
.- Once merged a workflow will trigger to deploy new/updated checks to Checkly.
Run the core CLI commands with npx checkly <command>
Command | Action |
---|---|
npx checkly test |
Dry run all the checks in your project |
npx checkly deploy |
Deploy your checks to the Checkly cloud |
npx checkly login |
Log in to your Checkly account |
npx checkly --help |
Show help for each command. |