[FEATURE] Удаление мусорных файлов, тесты в GitLab CI

This commit is contained in:
Gravit 2019-08-29 16:46:52 +07:00
parent a09a7c8cf6
commit ceff8a8684
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
6 changed files with 5 additions and 77 deletions

View file

@ -2,6 +2,7 @@ image: frekele/java
stages: stages:
- build - build
- test
- deploy - deploy
before_script: before_script:
@ -32,6 +33,10 @@ build:
- ServerWrapper/*.jar - ServerWrapper/*.jar
- modules/*.jar - modules/*.jar
expire_in: 1 week expire_in: 1 week
test:
stage: test
script:
- ./gradlew check
after_script: after_script:
- echo "End CI" - echo "End CI"

View file

@ -1,6 +0,0 @@
apply from: 'test_support.gradle'
dependencies {
compile project(':LaunchServer')
}

View file

@ -1,23 +0,0 @@
package pro.gravit.launcher.test.utils;
import java.io.IOException;
import java.nio.file.Files;
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.binary.LauncherBinary;
import pro.gravit.utils.helper.IOHelper;
public class EXENonWarningLauncherBinary extends LauncherBinary {
public EXENonWarningLauncherBinary(LaunchServer server) {
super(server, server.dir.resolve(server.config.binaryName + ".exe"));
}
@Override
public void build() throws IOException {
if (IOHelper.isFile(syncBinaryFile)) {
Files.delete(syncBinaryFile);
}
}
}

View file

@ -1,36 +0,0 @@
package pro.gravit.launcher;
import java.io.IOException;
import java.nio.file.Path;
import java.security.spec.InvalidKeySpecException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import pro.gravit.launcher.test.utils.EXENonWarningLauncherBinary;
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.utils.helper.LogHelper;
public class StartTest {
@TempDir
public Path dir;
@BeforeAll
public static void prepare() {
LogHelper.removeStdOutput();
LaunchServer.defaultLauncherEXEBinaryClass = EXENonWarningLauncherBinary.class;
}
@Test
public void checkLaunchServerStarts() {
/*try {
LaunchServer srv = new LaunchServer(dir, true, new String[]{"checkInstall"});
srv.run();
srv.commandHandler.eval(new String[]{"checkInstall"}, false);
srv.close();
} catch (InvalidKeySpecException | IOException e) {
throw new RuntimeException(e);
}*/
}
}

View file

@ -1,11 +0,0 @@
dependencies {
testCompile 'org.junit.jupiter:junit-jupiter:5.4.1'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}

View file

@ -7,7 +7,6 @@
include 'ServerWrapper' include 'ServerWrapper'
include 'LaunchServer' include 'LaunchServer'
include 'LaunchServerConsole' include 'LaunchServerConsole'
include 'LauncherTest'
include 'modules' include 'modules'
file('modules').eachDir { sub -> file('modules').eachDir { sub ->
if (sub.name.endsWith('_module') || sub.name.endsWith('_swmodule') || sub.name.endsWith('_lmodule')) include 'modules:' + sub.name if (sub.name.endsWith('_module') || sub.name.endsWith('_swmodule') || sub.name.endsWith('_lmodule')) include 'modules:' + sub.name