Add this into your pom.xml
:
<dependency>
<groupId>org.kiwitcms.java</groupId>
<artifactId>kiwitcms-junit-plugin</artifactId>
<version>x.y.z</version>
</dependency>
This plugin extends org.junit.jupiter.api.extension.Extension
and has
junit.jupiter.extensions.autodetection.enabled=true
configured by default in
pom.xml
. This means Jupiter will pick it up automatically.
You may alternatively decorate your test suite with the KiwiTcmsExtension
class
but that should be redundant:
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.jupiter.api.extension.ExtendWith;
import org.kiwitcms.java.junit.KiwiTcmsExtension;
@ExtendWith(KiwiTcmsExtension.class)
public class KiwiJsonRpcClientTest {
@Test
public void yourTest(){
assertThat(...);
}
}
Minimal config file ~/.tcms.conf
:
[tcms]
url = https://tcms.server/xml-rpc/
username = your-username
password = your-password
You can override the default file location by adding the Maven option tcmsConfigPath
followed by the full path to a config file. For example:
-DtcmsConfigPath=D:\Path\To\tcms.conf
For more info see tcms-api docs.
This plugin is only concerned with parsing the JUnit test results and reporting them to the backend. Behavior is controlled via environment variables.
For example this is how our own environment looks like::
#!/bin/bash
if [ "$TRAVIS_EVENT_TYPE" == "push" ]; then
# same as $TRAVIS_TAG when building tags
export TCMS_PRODUCT_VERSION=$TRAVIS_BRANCH
fi
if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then
export TCMS_PRODUCT_VERSION="PR-$TRAVIS_PULL_REQUEST"
fi
export TCMS_BUILD="$TRAVIS_BUILD_NUMBER-$(echo $TRAVIS_COMMIT | cut -c1-7)"
For a more detailed example see: http://kiwitcms.org/blog/atodorov/2019/02/22/how-to-use-kiwi-tcms-plugins-pt-1/
Files signed with EC1CEB7CDFA79FB5, Kiwi TCMS <info@kiwitcms.org>
C0C5FF36
to EC1CEB7CDFA79FB5
default_product_version
from API callTestRun.product_version
fieldThis version works only with Kiwi TCMS v10.0 or later!
This version works only with Kiwi TCMS v9.0 or later!
This version works only with Kiwi TCMS v8.0 or later!
product
field when calling TestCase.create()
APITCMS_RUN_ID
environment variableFixes moderate severity issue CVE-2019-16942, critical severity issue CVE-2019-16335 and critical severity issue CVE-2019-14540.
Fixes moderate severity issue CVE-2019-12086
You need your ~/.m2/settings.xml
to look something like this
<settings>
<servers>
<server>
<id>ossrh</id>
<username>kiwitcms-bot</username>
<password>***</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg2</gpg.executable>
<gpg.keyname>EC1CEB7CDFA79FB5</gpg.keyname>
</properties>
</profile>
</profiles>
</settings>
To push a new release/SNAPSHOT update the version string in pom.xml
and do
export GPG_TTY=$(tty)
mvn clean deploy -P release
NOTE: try ssh -X
if Maven fails to start GnuPG. It needs to ask for a password
which needs a terminal or X!
WARNING: consider setting junit.jupiter.extensions.autodetection.enabled=false
im pom.xml
if you are having problems building locally!
You will need Maven >= 3.3.9 which on RHEL/CentOS system can be obtained via SoftwareCollections:
scl enable rh-maven36 /bin/bash