Daniel Daniel - 1 year ago 110
Java Question

Java unit test: How to know its running on SemaphoreCI?

How is it possible to possible skip some of the tests on SemaphoreCI?
In other words, is it possible to know when we are running a specific test on Semaphore?

Answer Source

SemaphoreCI sets the CI environment variable to true.

For a complete list of SemaphoreCI's environment variables see Available Environment Variables

You could use this in your testing code or in your semaphore job's configuration commands to enable or disable specific maven profiles for example.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download