Acceptance Tests As Monitors
- A simple library that allows you to run junit tests as monitoring checks.
- Runs tests on a schedule and exposes results via a restful api that can be called from your monitoring setup (e.g. nagios, zabbix, icinga, pingdom etc etc)
<dependency>
<groupId>me.atam</groupId>
<artifactId>atam4j</artifactId>
<version>0.6.0</version>
</dependency>
http://mvnrepository.com/artifact/me.atam/atam4j
-
Include the atam4j maven dependency.
-
Write Junit based tests in the usual manner, with the exception of including them in the main application classpath instead of the tests classpath. This can be done by including them in the
src/main/java directory
instead of thesrc/test/java
directory. You can choose to either add a@Monitor
annotation to your test classes and let atam4j detect them or simply supply an array of classes to the builder. -
Instantiate
Atam4j
in your application.If specifying an explicit array of Test classes:
new Atam4j.Atam4jBuilder(metricsHealthCheckRegistry) .withTestClasses(HelloWorldTest.class) .build() .initialise();
If using
@Monitor
annotations to auto-detect test classes:new Atam4j.Atam4jBuilder(metricsHealthCheckRegistry) .build() .initialise();
-
Run your app and observe the status of the acceptance tests reported by the metrics health-check.
Refer to atam4j-sample-app for a complete working example.
https://oss.sonatype.org/content/repositories/snapshots/me/atam/atam4j/
Look for non-snapshot version https://oss.sonatype.org/content/groups/public/me/atam/atam4j/
mvn clean install
mvn clean test
Only core committers can release atam4j to maven central. You need Sonatype Nexus OSS account info for atam.me.
- Set version of the release
mvn versions:set -DnewVersion=${versionNumber}
- Commit the version back to git and push to remote
git commit -a -m "Prepare release v${versionNumber}"
git push
- Tag code
git tag -a v${versionNumber} -m 'version ${versionNumber}'
git push origin v${versionNumber}
-
Create release in Github - https://github.com/atam4j/atam4j/releases
-
Deploy to maven central
mvn clean deploy
A module which tests atam4j from end to end by starting an application that imports the core-library and runs dummy-tests.
The core library that runs tests and exposes the results via an api.
Module containing the atam4j annotations only. If you wish to annotate your tests, this is the only dependency required.
Contains dummy tests to verify that atam4j reports correctly on the status of tests that we know in advance will pass or fail. These are not run during the build.
Contains some common code shared by tests.