Results

Protobuf definition

syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "glimse/protobuf/header.proto";

package glimse.test;

enum Result {
     OTHER = 0;
     SKIPPED = 1;       // Test was skipped
     PASSED = 2;        // Test was run and passed ok
     PENDING = 3;       // Test was run and failed, but is not ready yet
     FAILED = 4;        // Test was run and failed
     INCONCLUSIVE = 5;  // Test was run but the result cannot be determined
     ERROR = 6;         // Test could not be run
}

message Metric  {
    string name = 1;
    bytes content = 2;   // Gzip encoded json-data. See description below
}

message Uri {
    string name = 1;
    string uri = 2;
}

// Test suite is started.
//
// Links to:
//    test.SuiteStarted     parent test suite (optional)
//    artifact.Created      built artifact
//
message SuiteStarted {
    Header header = 1;
    string name = 2;
    repeated string categories = 4;  // Extra info, for example hostname
}

// Test suite is ended.
//
// Links to:
//   test.SuiteStarted
//
message SuiteEnded {
    Header header = 1;
}

// Test case is defined.
// Must be sent before test case is started.
//
// Links to:
//   test.SuiteStarted
//   source.ChangeCreated  source code of the test (optional)
//   artifact.Created      built artifact (optional)
//
message CaseTriggered {
    Header header = 1;
    string name = 2;
}

//
// Test case was not run. (optional)
//
// Links to:
//   test.CaseTriggered
//
message CaseCanceled {
    Header header = 1;
    string reason = 2;
}

//
// Test case is started
//
// Links to:
//   test.CaseTriggered
//   common.EnvironmentDefined    Where test is running (optional)
//
message CaseStarted {
    Header header = 1;
}

//
// Test case is ended.
//
// Links to:
//    test.CaseTriggered
//
message CaseEnded {
    Header header = 1;
    repeated Metric metrics = 3;       // Traces and verdicts. See below for Metrics encoding
    Result result = 4;
    string result_info = 5;            // Human readable result
    repeated Uri persistent_logs = 7;  // Links to logs (currently not used)
}

//
// Test verdict (optional and currently ingored)
//
// This info must also be included in Metrics in CaseEnded
//
// Links to:
//   test.CaseTriggered
//
message Verdict {
    message Backtrace {
        string file = 1;          // Filename including path.
        string line = 2;          // Line number.
        string method_name = 3;   // Method name.
    }

Header header = 1;
Result result = 2;
string result_info = 3;       // Possible extra information, like 'Pending'
repeated Backtrace backtrace = 4;
string description = 5;       // Explaination of what happended
google.protobuf.Timestamp detected_at = 6;

}

//
// Metrics encoding
//
// Content is gzip compressed json data.
//
// Example 1: Verdict
//
// gzip_encode({"events": [{"type": "FAILED",
//                          "time": {"seconds": 1668070343, "nanos": 447201251},
//                          "text": "at /tmp/somecode.rb:44",
//                          "sub_events": [
//                            {"name": "text",
//                            "text": "Command failed\nExpected 1 got 0\n" }
//                           ]
//                        }]
//             })
//
// Example 2. Info Trace
//
// gzip_encode({"events": [{"type": "INFO",
//                          "time": {"seconds": 1668070343, "nanos": 447201251},
//                          "text": "Output from /tmp/somecode.rb",
//                          "sub_events": [
//                            {"name": "text",
//                             "text": "Started ok\nRunning ok\nCommand doned\n" }
//                           ]
//                        }]
//              })