Search in sources :

Example 6 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.

the class DockerIT method testLogWithoutStdOut.

@Test
public void testLogWithoutStdOut() throws Exception {
    byte[] payload = archive(DockerIT.class.getResource("dockerLogWithoutStdOut").toURI());
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.image", ITConstants.DOCKER_ANSIBLE_IMAGE);
    StartProcessResponse spr = start(input);
    ProcessApi processApi = new ProcessApi(getApiClient());
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    assertNotNull(pir.getLogFileName());
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*DOCKER: Hello, world.*", ab);
    assertLog(".*DOCKER: STDERR WORKS.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 7 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.

the class DockerIT method test.

@Test
public void test() throws Exception {
    byte[] payload = archive(DockerIT.class.getResource("docker").toURI());
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.image", ITConstants.DOCKER_ANSIBLE_IMAGE);
    StartProcessResponse spr = start(input);
    ProcessApi processApi = new ProcessApi(getApiClient());
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    assertNotNull(pir.getLogFileName());
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*DOCKER: Hello, world.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 8 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.

the class DockerIT method testLogWithStdErr.

@Test
public void testLogWithStdErr() throws Exception {
    byte[] payload = archive(DockerIT.class.getResource("dockerLogWithStdErr").toURI());
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.image", ITConstants.DOCKER_ANSIBLE_IMAGE);
    StartProcessResponse spr = start(input);
    ProcessApi processApi = new ProcessApi(getApiClient());
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    assertNotNull(pir.getLogFileName());
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*STDERR: STDERR WORKS.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 9 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.

the class DockerIT method testPullRetry.

@Test
public void testPullRetry() throws Exception {
    byte[] payload = archive(DockerIT.class.getResource("dockerPullRetry").toURI());
    StartProcessResponse spr = start(payload);
    ProcessApi processApi = new ProcessApi(getApiClient());
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    byte[] ab = getLog(pir.getLogFileName());
    assertLogAtLeast(".*Error pulling the image.*", 2, ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 10 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.

the class ClasspathIsolationIT method testBrokenDeps.

@Test
public void testBrokenDeps() throws Exception {
    byte[] payload = archive(ClasspathIsolationIT.class.getResource("brokenDeps").toURI());
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    Map<String, Object> cfg = new HashMap<>();
    cfg.put("dependencies", new String[] { "mvn://com.walmartlabs.concord.it.tasks:broken-deps:" + ITConstants.PROJECT_VERSION });
    input.put("request", cfg);
    StartProcessResponse spr = start(input);
    ProcessApi processApi = new ProcessApi(getApiClient());
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*hello!.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Aggregations

StartProcessResponse (com.walmartlabs.concord.client.StartProcessResponse)57 Test (org.junit.jupiter.api.Test)56 ProcessApi (com.walmartlabs.concord.client.ProcessApi)54 ProcessEntry (com.walmartlabs.concord.client.ProcessEntry)54 HashMap (java.util.HashMap)34 URI (java.net.URI)23 Path (java.nio.file.Path)4 File (java.io.File)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 UUID (java.util.UUID)2 ZipArchiveOutputStream (org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream)2 ApiClient (com.walmartlabs.concord.ApiClient)1 ApiException (com.walmartlabs.concord.ApiException)1 ProjectEntry (com.walmartlabs.concord.client.ProjectEntry)1 ProjectsApi (com.walmartlabs.concord.client.ProjectsApi)1 PosixFilePermission (java.nio.file.attribute.PosixFilePermission)1 HashSet (java.util.HashSet)1 WebElement (org.openqa.selenium.WebElement)1