-
Notifications
You must be signed in to change notification settings - Fork 1
Development
All jUnit tests and all integration tests need to pass for pull requests.
- clone repository https://github.com/proximax-storage/java-xpx-chain-sdk and
cd
to the working tree - set variable
JAVA_HOME
to the location of Java8 JDK - run build and jUnit tests
./gradlew build
- find the SDK jar in
build/jars
If you need SDK jar together with all the dependencies then run ./gradlew distZip
. That will create zip archive in build/distributions
with all the jars needed to use the SDK.
Basic batch of quick low-level tests is executed automatically with every build. HTML report can be found in build/reports/tests/test
.
Integration tests are not executed during build by default because they use actual network and burn tokens. To run integration tests you need to do following
- configure the test parameters (node url, network type, seed account, timeout). There are 2 options how to do this:
- edit
e2e/resources/config.properties
(xpxsdk.conf.url
,xpxsdk.conf.network_type
,xpxsdk.conf.seed.private_key
,xpxsdk.conf.timeout
) - set environment variables (
E2E_URL
,E2E_NETWORK_TYPE
,E2E_SEED_PRIVATE_KEY
,E2E_TIMEOUT
)
- edit
- run integration tests
./gradlew e2eTest
Integration tests generate HTML report. It can be found in build/reports/tests/e2eTest
.
Code coverage report is generated from test execution reports. That means you need to run first tests and then the coverage report generator.
If you have already executed tests and are looking just for the coverage report then run ./gradlew jacocoTestReport
.
If you want to get clean report then
- make configuration as needed for integration tests
- run
./gradlew clean build e2eTest jacocoTestReport
Report will be in directory build/reports/jacoco/test/html
Publishing requires OpenPGP credentials to be configured for signing of the publication.
Before publishing make sure that
- signing credentials are set-up and
~/.gradle/gradle.properties
contains signing configuration - you have publishing credentials to maven central and those credentials are present in
~/.gradle/gradle.properties
(nexusUsername
,nexusPassword
)
To perform publishing run ./gradlew publish
Copyright (c) 2019 ProximaX Limited