Tests are boring. Running tests is even more boring. No one has time and/or patience to run the tests.
Fear no more brave developer! JVoid is here to rescue you and your team from the dreaded world of waiting for tests to complete.
Using extremely intelligent hacks^C^C^C^C^C algorithms, JVoid keeps track of modifications to your codebase and makes sure that only the tests relevant for those modifications are executed. Basically it skips all the tests whose outcome would not be altered by your changes to the code.
To execute your tests with jVoid you only need to attach the jVoid agent to your JVM and, at a minimum, have a configuration file with the basePackage
Example jvoid.config file:
app.package=com.example.app
Example build.gradle file:
apply plugin: 'java'
repositories {
mavenCentral()
}
configurations {
testAgent
}
test.doFirst {
jvmArgs "-javaagent:${configurations.testAgent.singleFile}"
}
dependencies {
testCompile <JUnit/Spock/TestNG dependencies>
testAgent "io.jvoid:jvoid:1.0.0"
}
Example pom.xml:
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-javaagent:${maven.dependency.jvoid.jvoid.jar.path}</argLine>
</configuration>
</plugin>
</plugins>
...java -javaagent:<absolute path to jvoid-1.0.0.jar>[:<abolsute path to jvoid configuration file>] <other parameters>
All of jVoid configurations are stored in a dedicated file. This file is loaded from any (or all!) the following locations. The configurations in one file will overwrite the previously configurations:
- User home directory
- Working directory
- java agent parameter
| Property | Optional | Default value | Description |
|---|---|---|---|
| basePackage | ❌ | The base package where all your application code resides | |
| db.url | ✅ | jdbc:h2:./jvoiddb; AUTO_RECONNECT=TRUE; AUTO_SERVER=TRUE; PAGE_SIZE=512; CACHE_SIZE=131072; CACHE_TYPE=SOFT_LRU; QUERY_CACHE_SIZE=64; mode=MySQL |
The url to connect to the datbase |
| db.username | ✅ | jvoid | The database username |
| db.password | ✅ | jvoid | The database password |
| app.heuristic.excludeCglib | ✅ | true | Exclude CGLIB methods |
| app.heuristic.excludeJacoco | ✅ | true | Exclude Jacoco methods |
| app.heuristic.excludeGroovyCallSite | ✅ | true | Exclude Groovy CallSite implementations |
| app.includes | ✅ | Regex to fine tune which methods will be used. Empty means everything is included. | |
| app.excludes | ✅ | Regex to fine tune which methods will be excluded from JVoid . Empty means nothing is exclude. |
The test frameworks currently supported by jVoid are:
- JUnit4
- Spock
TestNG support is planned for future releases.
By design JVoid is conservative and, in doubt, will never skip a test. In our view it this cases it is better to wait a bit for the tests to complete than let a bug creep in.
Yes! MySQL is also supported. Just add a MySQL connection url/username/password to your jvoid.config and a MySQL connector driver to the test classpath.
build.gradle
dependencies {
testCompile "org.codehaus.groovy:groovy-all:2.4.1"
testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
testCompile 'mysql:mysql-connector-java:5.1.38'
testAgent "io.jvoid:jvoid:1.0.0"
}
jvoid.config:
app.package=com.example.app
db.url=jdbc:mysql://localhost/jvoid
db.username=user
db.password=$ecr3t
At this moment you will need to delete the jeniusdb.* files in your working directory or delete the data from the external MySQL database server.
Unfortunately, at the present time jVoid and JaCoCo are mutually exclusive. Theoretically, that also makes sense because jVoid allows you to skip useless tests executions that are though necessary to gather the data used by JaCoCo for the full coverage reports. A solution for now, would be to execute JaCoCo (and suppress jVoid) based on an environment variable that will be set only on your CI runtime. In that way, you'll always have a full-coverage report from your CI and super-fast development time as an awesome software ninja!
But no worries: full support of JaCoCo (and its integration) are planned for future releases.
No! jVoid is totally local (except if you connect to an external database server). Not even a single bit is sent anywhere :)
Guys, I really need [fill with any feature name and/or description], otherwise JVoid is useless for me/my organization!
We are glad you spent a bit of your busy time looking at jVoid. Please tell us that using an issue in GitHub and/or suggest a change via a Pull Request that contains that impressive feature.
Awww... Thanks! If you can code, create a Pull Request with that new amazing feature or squash a nasty bug. If you can't, we are sure that you have an awesome skill that is super useful! :)
Check the documentation at: http://central.sonatype.org
Configure access to ossrh repoitory in your ~/.m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>ossrh</id>
<username>_______</username>
<password>_______</password>
</server>
</servers>
</settings>
Import keys into your GPG
Execute a deploy with maven
./mvnw clean deploy -Possrh -Dgpg.passphrase=<key passphrase>