summaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java
blob: f1d07fc90978e92ba157d70e43cc6458c1395112 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.yahoo.vespa.hosted.controller.api.integration.deployment;

import java.net.URI;

/**
 * Allows running some predefined tests -- typically remotely.
 *
 * @author jonmv
 */
public interface TesterCloud {

    /** Signals the tester to run its tests. */
    void startTests(URI testerUrl, Suite suite, byte[] config);

    /** Returns the currently stored logs from the tester. */
    byte[] getLogs(URI testerUrl);

    /** Returns the current status of the tester. */
    Status getStatus(URI testerUrl);


    enum Status {

        /** Tests have not yet started. */
        NOT_STARTED,

        /** Tests are running. */
        RUNNING,

        /** Tests failed. */
        FAILURE,

        /** The tester encountered an exception. */
        ERROR,

        /** The tests were successful. */
        SUCCESS

    }


    enum Suite {

        system,

        staging,

        production;

        public static Suite of(JobType type) {
            if (type == JobType.systemTest) return system;
            if (type == JobType.stagingTest) return  staging;
            if (type.isProduction()) return production;
            throw new AssertionError("Unknown JobType '" + type + "'!");
        }

    }

}