Acceptance Tests As Monitors
- A simple library that allows you to run junit tests as monitoring checks, using the dropwizard framework
- 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>{atam4j.version}</version>
</dependency>
where atam4j.version
is the version number you want to use. The latest version is as shown below
- Include the atam4j maven dependency along with the following required dependencies
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>{dw.version}</version>
</dependency>
where {dw.version}
should be replaced by the version number as defined by the dw.version
property in the main
project pom
-
Write Junit based tests in the usual manner. 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. This is explained further, below. -
Instantiate
Atam4j
in your main dropwizard application class, as shown below
If specifying an explicit array of Test classes:
new Atam4j.Atam4jBuilder(jerseyEnvironment)
.withTestClasses(HelloWorldTest.class)
.build()
.initialise();
If using @Monitor
annotations to auto-detect test classes:
new Atam4j.Atam4jBuilder(jerseyEnvironment)
.build()
.initialise();
where jerseyEnvironment
is an object of type io.dropwizard.jersey.setup.JerseyEnvironment
- Run your app and observe the status of the acceptance tests reported by the
/tests
endpoint.
Refer to atam4j-sample-app for a complete working example.
Refer to our Wiki
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
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/
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.