diff --git a/build.gradle b/build.gradle index 8c3dd98..7a9463e 100644 --- a/build.gradle +++ b/build.gradle @@ -119,3 +119,26 @@ tasks.register('itCleanRun', JavaExec) { dependsOn testClasses } + +tasks.register('itDeployServer', JavaExec) { + group = "build" + description = "Build → upload to server → clean remote data → restart service → run IT against server" + + classpath = sourceSets.test.runtimeClasspath + mainClass = "test.it.IT_DeployRestartAndRunRemoteMain" + + // можно переопределить при запуске: + // ./gradlew itDeployServer -Dit.remoteHost=... -Dit.wsUri=... + systemProperty "it.remoteHost", System.getProperty("it.remoteHost", "10.147.20.7") + systemProperty "it.remoteUser", System.getProperty("it.remoteUser", "user") + systemProperty "it.remoteDir", System.getProperty("it.remoteDir", "/home/user/docker/shine-server") + systemProperty "it.remoteDataDir", System.getProperty("it.remoteDataDir", "/home/user/docker/shine-server/data") + systemProperty "it.service", System.getProperty("it.service", "shine-server") + systemProperty "it.localJar", System.getProperty("it.localJar", "build/libs/shine-server.jar") + + systemProperty "it.wsUri", System.getProperty("it.wsUri", "wss://shineup.me/ws") + systemProperty "it.login", System.getProperty("it.login", "anya24") + + dependsOn testClasses +} + diff --git a/src/test/java/test/it/utils/TestConfig.java b/src/test/java/test/it/utils/TestConfig.java index 8f0014a..2e49145 100644 --- a/src/test/java/test/it/utils/TestConfig.java +++ b/src/test/java/test/it/utils/TestConfig.java @@ -22,7 +22,12 @@ public final class TestConfig { private TestConfig() {} - public static final String WS_URI = "ws://localhost:7070/ws"; + public static final String WS_URI_LOCAL = "ws://localhost:7070/ws"; + public static final String WS_URI_Server = "wss://shineup.me/ws"; + + // по умолчанию LOCAL, но можно переопределить: -Dit.wsUri=... + public static final String WS_URI = System.getProperty("it.wsUri", WS_URI_LOCAL); + public static final long TEST_BCH_LIMIT = 50_000_000L; public static final String TEST_CLIENT_INFO = "it-tests";