Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #51 from radixdlt/fix/radix-regression-tests-mono-…
Browse files Browse the repository at this point in the history
…repo

Fix in gradle and regression test code
  • Loading branch information
shambupujar authored Feb 3, 2021
2 parents 46ac252 + 3456149 commit 7df4f22
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 223 deletions.
21 changes: 15 additions & 6 deletions radixdlt-regression/system-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxjava'
implementation 'org.json:json'

testImplementation group: 'io.cucumber', name: 'cucumber-groovy', version: '4.7.1'
testImplementation 'org.codehaus.groovy:groovy-all:2.4.12'
testImplementation 'io.cucumber:cucumber-core:2.1.0'
testImplementation 'io.cucumber:cucumber-java:5.5.0'
testImplementation 'io.cucumber:cucumber-junit:5.5.0'
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.6.1'
testCompile group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.6.1'
testImplementation group: 'org.awaitility', name: 'awaitility', version: '4.0.3'
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
testCompile group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
testImplementation group: 'me.alexpanov', name: 'free-port-finder', version: '1.1.1'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'io.cucumber:cucumber-java:6.8.1'
testImplementation 'io.cucumber:cucumber-junit:6.8.1'
}

task copyCLIJar {
Expand Down Expand Up @@ -69,6 +69,9 @@ task dockerSystemTests(type: Test) {
systemProperties System.getProperties()
systemProperties['logs.dir'] = "${testResultsDir}/dockerSystemTests"
exclude "Runner.class"
jacoco {
enabled false
}
}

task clusterSystemTests(type: Test) {
Expand All @@ -78,6 +81,9 @@ task clusterSystemTests(type: Test) {
testLogging.showStandardStreams = true
systemProperties System.getProperties()
exclude "Runner.class"
jacoco {
enabled false
}
}

task ephemeralClusterSystemTests(type: Test) {
Expand All @@ -88,4 +94,7 @@ task ephemeralClusterSystemTests(type: Test) {
systemProperties System.getProperties()
systemProperties['logs.dir'] = "${testResultsDir}/ephemeralClusterSystemTests"
exclude "Runner.class"
jacoco {
enabled false
}
}
4 changes: 2 additions & 2 deletions radixdlt-regression/system-tests/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV PATH=/opt/gradle-6.6.1/bin:$PATH

RUN docker --version

COPY . /src
WORKDIR /src
COPY . /core
WORKDIR /core
USER root
CMD /bin/bash
29 changes: 0 additions & 29 deletions radixdlt-regression/system-tests/src/test/groovy/Runner.groovy

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ class CmdHelper {
//exportVars = TempUniverseCreator.getHardcodedUniverse(); TODO a bit weird but this helps development on windows
throw new RuntimeException("For these tests to run on windows, you need to find a way to provide a universe.")
}
String gradlewPath = System.getProperty("user.dir")
(exportVars, error) = runCommand("${gradlewPath}/gradlew -P validators=${numNodes} clean generateDevUniverse",
String gradlewPath = System.getenv('CORE_DIR')
(exportVars, error) = runCommand("${gradlewPath}/gradlew -P validators=${numNodes} :radixdlt:clean :radixdlt:generateDevUniverse",
null,false, true,"${System.getenv('CORE_DIR')}/radixdlt-core/radixdlt");
String[] envVars = exportVars
.findAll({ it.contains("export") })
Expand All @@ -299,7 +299,7 @@ class CmdHelper {

static void cleanCoreGradleOutput(){
String gradlewPath = System.getProperty("user.dir")
runCommand("${gradlewPath}/gradlew clean",null,true,true,"${System.getenv('CORE_DIR')}");
runCommand("${gradlewPath}/gradlew :radixdlt:clean",null,true,true,"${System.getenv('CORE_DIR')}");
}

static String getNodeValidator(String[] allEnvVariables,options){
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ docker create --pid=host --privileged ^
--network=host --cap-add=NET_ADMIN ^
-e CONTAINER_NAME -e TEST_DURATION -e CORE_DIR=%CORE_DIR% ^
--name=%TEST_EXECUTOR% radix-system-test ^
gradle clean dockerSystemTests
./gradlew clean -p radixdlt-regression/system-tests :radixdlt-regression:system-tests:dockerSystemTests --stacktrace --info
docker start -a %TEST_EXECUTOR%
docker cp %TEST_EXECUTOR%:src/system-tests .
12 changes: 6 additions & 6 deletions radixdlt-regression/run-docker-tests.sh → run-docker-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ echo "Test executor Container Name = $test_executor"
echo "Duration of individual tests = $TEST_DURATION"

if [[ -z "${CORE_DIR}" ]]; then
echo " CORE_DIR environment variable isn't setup. Exiting the tests"
exit 1
CORE_DIR=$(echo $(pwd))
echo " CORE_DIR is ${CORE_DIR}"
fi

docker build -f system-tests/docker/Dockerfile -t radix-system-test .
docker build -f radixdlt-regression/system-tests/docker/Dockerfile -t radix-system-test .
docker ps -a

../gradlew clean
docker rm -f "${test_executor}" || true
# Currently there is volume mount consisting of core code, may need to use docker named volumes
docker create --pid=host --privileged \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${CORE_DIR}:/core \
--network=host --cap-add=NET_ADMIN \
-e CONTAINER_NAME -e TEST_DURATION -e CORE_DIR=/core \
--name=${test_executor} radix-system-test \
./gradlew clean dockerSystemTests --refresh-dependencies --info
./gradlew clean -p radixdlt-regression/system-tests :radixdlt-regression:system-tests:dockerSystemTests --stacktrace --refresh-dependencies --info
docker start -a "${test_executor}"
docker cp $test_executor:src/system-tests .
docker cp $test_executor:/core/radixdlt-regression/system-tests .
test_status=$(docker inspect $test_executor --format='{{.State.ExitCode}}')
exit $test_status
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include ':radixdlt-java'
include ':radixdlt-java-common'
include ':radixdlt-java-examples'
include ':radixdlt-regression'
include ':system-tests'
include ':radixdlt-regression:system-tests'

project(':faucet-service').projectDir = new File('radixdlt-core/faucet-service')
project(':radixdlt').projectDir = new File('radixdlt-core/radixdlt')
Expand All @@ -19,4 +19,4 @@ project(':radixdlt-java').projectDir = new File('radixdlt-java/radixdlt-java')
project(':radixdlt-java-common').projectDir = new File('radixdlt-java-common')
project(':radixdlt-java-examples').projectDir = new File('radixdlt-java/examples')
project(':radixdlt-regression').projectDir = new File('radixdlt-regression')
project(':system-tests').projectDir = new File('radixdlt-regression/system-tests')
project(':radixdlt-regression:system-tests').projectDir = new File('radixdlt-regression/system-tests')

0 comments on commit 7df4f22

Please sign in to comment.