You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Переименованы методы получения имени агента для 1с и для едт в классе JobConfiguration, добавлен класс EDT, переопределены вызовы в шагах EDT на метод в новом классе
This commit is contained in:
@@ -64,7 +64,7 @@ class ConfigurationReaderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testV8versionMethod() throws IOException {
|
||||
void testV8AgentLabel() throws IOException {
|
||||
// given
|
||||
String config = IOUtils.resourceToString(
|
||||
"jobConfiguration.json",
|
||||
@@ -76,11 +76,11 @@ class ConfigurationReaderTest {
|
||||
JobConfiguration jobConfiguration = ConfigurationReader.create(config);
|
||||
|
||||
// then
|
||||
assertThat(jobConfiguration.v8version()).isEqualTo("8.3.14.1944");
|
||||
assertThat(jobConfiguration.v8AgentLabel()).isEqualTo("8.3.14.1944");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEdtVersionForRingMethod() throws IOException {
|
||||
void testEdtAgentLabel() throws IOException {
|
||||
// given
|
||||
String config = IOUtils.resourceToString(
|
||||
"jobConfiguration.json",
|
||||
@@ -92,11 +92,11 @@ class ConfigurationReaderTest {
|
||||
JobConfiguration jobConfiguration = ConfigurationReader.create(config);
|
||||
|
||||
// then
|
||||
assertThat(jobConfiguration.edtVersionForRing()).isEqualTo("edt@2021.3.4:x86_64");
|
||||
assertThat(jobConfiguration.edtAgentLabel()).isEqualTo("edt@2021.3.4:x86_64");
|
||||
}
|
||||
|
||||
@Disabled
|
||||
void testinfoBaseFromFilesMethod() throws IOException {
|
||||
void testInfoBaseFromFiles() throws IOException {
|
||||
// given
|
||||
String config = IOUtils.resourceToString(
|
||||
"jobConfiguration.json",
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package ru.pulsar.jenkins.library.utils;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import ru.pulsar.jenkins.library.configuration.ConfigurationReader;
|
||||
import ru.pulsar.jenkins.library.configuration.JobConfiguration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class EDTTest {
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
TestUtils.setupMockedContext();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRingModule() throws IOException {
|
||||
|
||||
// given
|
||||
String config = IOUtils.resourceToString(
|
||||
"jobConfiguration.json",
|
||||
StandardCharsets.UTF_8,
|
||||
this.getClass().getClassLoader()
|
||||
);
|
||||
|
||||
// when
|
||||
JobConfiguration jobConfiguration = ConfigurationReader.create(config);
|
||||
String edtModule = EDT.ringModule(jobConfiguration);
|
||||
|
||||
// then
|
||||
assertThat(edtModule).isEqualTo("edt@2021.3.4:x86_64");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user