Skip to main content Skip to complementary content

Continuous API testing

Run your tests automatically on a Continuous Integration (CI).

Talend Cloud API Tester's CLI test runner integrates well with most CI solutions, all you need is the latest Java JDK and Maven installed on your CI machine.

The following solutions are compatible with Talend Cloud API Tester:

  • Jenkins
  • Azure Pipelines
  • AWS CodeBuild and CodePipeline
  • Travis CI
  • CircleCI
  • Team Foundation Server
  • Gitlab CI/CD

Other CI/CD solutions may be compatible too. If you have another working solution, please contact us so we can update this page.

CI workflow

Your API tests should follow this flow:

Diagram of the continuous integration workflow.

You should build your API from the sources, then run unit tests, deploy it and finally run integration tests against it using Talend Cloud API Tester.

Technically, there are two main ways to do so which are described below. For more information on how to configure your CI builds, see Talend Cloud API Tester Examples.

Basic workflow: test your main branch once a day

The files are fetched from the source control every night, and this triggers the integration pipeline: after running the unit tests and packaging the service implementation, the pipeline deploys it to a staging environment. Then, the API tests are run to validate that the API is operating as expected.

If you choose to test your API on a static environment, you can run the test on demand or schedule your job to run nightly. This solution is easy to implement and does the job, but note that:

  • Only one test can run at a time.
  • The data in your API gets "polluted" when running a test and you must clean it before running another test or they won't run in the same conditions.
  • Anybody with access to that environment can request the API while the test is running, which can result in hard-to-debug test failures.

If you are testing on a staging environment, you can create a CRON task that runs once a night and make it:

  • Pull the API code and test file from GitHub.
  • Build and test your API code.
  • Deploy it to your environment.
  • Run your API tests against it with the maven plugin.
  • Get your test reports.

Once the job exists, you should be able to run it on-demand too.

Advanced workflow: check your API on each commit

A build is triggered on each commit to the source control. A short-lived container is used to deploy the service implementation. API tests are performed against the running API. After testing, the status of the branch is sent back to the source control.

A more advanced solution is to deploy your API in a container for each job run. That allows you to:

  • Test multiple branches at the same time.
  • Work in a compartmentalized environment.
  • Test every commit.

If you are testing your API in containers, you can create a task that runs each time the sources are updated and make it:

  • Build and unit tests the API code.
  • Deploy it in a container.
  • Run your API tests against it with the Talend Cloud API Tester Maven plugin.
  • Get your test reports.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!