Class: Google::Apis::ToolresultsV1beta3::Step
- Inherits:
-
Object
- Object
- Google::Apis::ToolresultsV1beta3::Step
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/toolresults_v1beta3/classes.rb,
generated/google/apis/toolresults_v1beta3/representations.rb,
generated/google/apis/toolresults_v1beta3/representations.rb
Overview
A Step represents a single operation performed as part of Execution. A step can be used to represent the execution of a tool ( for example a test runner execution or an execution of a compiler). Steps can overlap (for instance two steps might have the same start time if some operations are done in parallel). Here is an example, let's consider that we have a continuous build is executing a test runner for each iteration. The workflow would look like: - user creates a Execution with id 1 - user creates an TestExecutionStep with id 100 for Execution 1 - user update TestExecutionStep with id 100 to add a raw xml log + the service parses the xml logs and returns a TestExecutionStep with updated TestResult(s). - user update the status of TestExecutionStep with id 100 to COMPLETE A Step can be updated until its state is set to COMPLETE at which points it becomes immutable.
Instance Attribute Summary collapse
-
#completion_time ⇒ Google::Apis::ToolresultsV1beta3::Timestamp
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution.
-
#creation_time ⇒ Google::Apis::ToolresultsV1beta3::Timestamp
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution.
-
#description ⇒ String
A description of this tool For example: mvn clean package -D skipTests=true - In response: present if set by create/update request - In create/update request: optional Corresponds to the JSON property
description
. -
#device_usage_duration ⇒ Google::Apis::ToolresultsV1beta3::Duration
A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
-
#dimension_value ⇒ Array<Google::Apis::ToolresultsV1beta3::StepDimensionValueEntry>
If the execution containing this step has any dimension_definition set, then this field allows the child to specify the values of the dimensions.
-
#has_images ⇒ Boolean
(also: #has_images?)
Whether any of the outputs of this step are images whose thumbnails can be fetched with ListThumbnails.
-
#labels ⇒ Array<Google::Apis::ToolresultsV1beta3::StepLabelsEntry>
Arbitrary user-supplied key/value pairs that are associated with the step.
-
#name ⇒ String
A short human-readable name to display in the UI.
-
#outcome ⇒ Google::Apis::ToolresultsV1beta3::Outcome
Interprets a result so that humans and machines can act on it.
-
#run_duration ⇒ Google::Apis::ToolresultsV1beta3::Duration
A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution.
-
#state ⇒ String
The initial state is IN_PROGRESS.
-
#step_id ⇒ String
A unique identifier within a Execution for this Step.
-
#test_execution_step ⇒ Google::Apis::ToolresultsV1beta3::TestExecutionStep
A step that represents running tests.
-
#tool_execution_step ⇒ Google::Apis::ToolresultsV1beta3::ToolExecutionStep
Generic tool step to be used for binaries we do not explicitly support.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Step
constructor
A new instance of Step.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Step
Returns a new instance of Step
2099 2100 2101 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2099 def initialize(**args) update!(**args) end |
Instance Attribute Details
#completion_time ⇒ Google::Apis::ToolresultsV1beta3::Timestamp
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a 24-hour linear smear. The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.
Examples
Example 1: Compute Timestamp from POSIX time()
.
Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0);
Example 2: Compute Timestamp from POSIX gettimeofday()
.
struct timeval tv; gettimeofday(&tv, NULL);
Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.
tv_usec * 1000);
Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime()
.
FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.
dwHighDateTime) << 32) | ft.dwLowDateTime;
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is
11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp
timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
Example 4: Compute Timestamp from Java System.currentTimeMillis()
.
long millis = System.currentTimeMillis();
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .
setNanos((int) ((millis % 1000) * 1000000)).build();
Example 5: Compute Timestamp from current time in Python.
timestamp = Timestamp() timestamp.GetCurrentTime()
JSON Mapping
In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is "year
-
month
-day
Thour
:min
:sec
[.frac_sec
]Z" where year
is always
expressed using four digits while month
, day
, hour
, min
, and sec
are
zero-padded to two digits each. The fractional seconds, which can go up to 9
digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
serializer should always use UTC (as indicated by "Z") when printing the
Timestamp type and a proto3 JSON parser should be able to accept both UTC and
other timezones (as indicated by an offset).
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
January 15, 2017.
In JavaScript, one can convert a Date object to this format using the standard
toISOString() method. In Python, a standard
datetime.datetime
object can be converted to this format using strftime
with the time
format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda
Time's ISODateTimeFormat.dateTime()
to obtain a
formatter capable of generating timestamps in this format.
Corresponds to the JSON property completionTime
1868 1869 1870 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1868 def completion_time @completion_time end |
#creation_time ⇒ Google::Apis::ToolresultsV1beta3::Timestamp
A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a 24-hour linear smear. The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from RFC 3339 date strings.
Examples
Example 1: Compute Timestamp from POSIX time()
.
Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0);
Example 2: Compute Timestamp from POSIX gettimeofday()
.
struct timeval tv; gettimeofday(&tv, NULL);
Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.
tv_usec * 1000);
Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime()
.
FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.
dwHighDateTime) << 32) | ft.dwLowDateTime;
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is
11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp
timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
Example 4: Compute Timestamp from Java System.currentTimeMillis()
.
long millis = System.currentTimeMillis();
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .
setNanos((int) ((millis % 1000) * 1000000)).build();
Example 5: Compute Timestamp from current time in Python.
timestamp = Timestamp() timestamp.GetCurrentTime()
JSON Mapping
In JSON format, the Timestamp type is encoded as a string in the RFC 3339 format. That is, the format is "year
-
month
-day
Thour
:min
:sec
[.frac_sec
]Z" where year
is always
expressed using four digits while month
, day
, hour
, min
, and sec
are
zero-padded to two digits each. The fractional seconds, which can go up to 9
digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
serializer should always use UTC (as indicated by "Z") when printing the
Timestamp type and a proto3 JSON parser should be able to accept both UTC and
other timezones (as indicated by an offset).
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
January 15, 2017.
In JavaScript, one can convert a Date object to this format using the standard
toISOString() method. In Python, a standard
datetime.datetime
object can be converted to this format using strftime
with the time
format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda
Time's ISODateTimeFormat.dateTime()
to obtain a
formatter capable of generating timestamps in this format.
Corresponds to the JSON property creationTime
1925 1926 1927 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1925 def creation_time @creation_time end |
#description ⇒ String
A description of this tool For example: mvn clean package -D skipTests=true
- In response: present if set by create/update request - In create/update
request: optional
Corresponds to the JSON property
description
1932 1933 1934 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1932 def description @description end |
#device_usage_duration ⇒ Google::Apis::ToolresultsV1beta3::Duration
A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +- 10,000 years.
Examples
Example 1: Compute Duration from two Timestamps in pseudo code.
Timestamp start = ...; Timestamp end = ...; Duration duration = ...;
duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos -
start.nanos;
if (duration.seconds 0) duration.seconds += 1; duration.nanos -= 1000000000;
else if (durations.seconds > 0 && duration.nanos < 0) duration.seconds -=
1; duration.nanos += 1000000000;
Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
Timestamp start = ...; Duration duration = ...; Timestamp end = ...;
end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos +
duration.nanos;
if (end.nanos = 1000000000) end.seconds += 1; end.nanos -= 1000000000;
Example 3: Compute Duration from datetime.timedelta in Python.
td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.
FromTimedelta(td)
JSON Mapping
In JSON format, the Duration type is encoded as a string rather than an object,
where the string ends in the suffix "s" (indicating seconds) and is preceded
by the number of seconds, with nanoseconds expressed as fractional seconds.
For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "
3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.
000000001s", and 3 seconds and 1 microsecond should be expressed in JSON
format as "3.000001s".
Corresponds to the JSON property deviceUsageDuration
1966 1967 1968 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1966 def device_usage_duration @device_usage_duration end |
#dimension_value ⇒ Array<Google::Apis::ToolresultsV1beta3::StepDimensionValueEntry>
If the execution containing this step has any dimension_definition set, then
this field allows the child to specify the values of the dimensions.
The keys must exactly match the dimension_definition of the execution.
For example, if the execution has dimension_definition = ['attempt', 'device']
then a step must define values for those dimensions, eg. dimension_value = [
'attempt': '1', 'device': 'Nexus 6']
If a step does not participate in one dimension of the matrix, the value for
that dimension should be empty string. For example, if one of the tests is
executed by a runner which does not support retries, the step could have
dimension_value = ['attempt': '', 'device': 'Nexus 6']
If the step does not participate in any dimensions of the matrix, it may leave
dimension_value unset.
A PRECONDITION_FAILED will be returned if any of the keys do not exist in the
dimension_definition of the execution.
A PRECONDITION_FAILED will be returned if another step in this execution
already has the same name and dimension_value, but differs on other data
fields, for example, step field is different.
A PRECONDITION_FAILED will be returned if dimension_value is set, and there is
a dimension_definition in the execution which is not specified as one of the
keys.
- In response: present if set by create - In create request: optional - In
update request: never set
Corresponds to the JSON property
dimensionValue
1992 1993 1994 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1992 def dimension_value @dimension_value end |
#has_images ⇒ Boolean Also known as: has_images?
Whether any of the outputs of this step are images whose thumbnails can be fetched with ListThumbnails.
- In response: always set - In create/update request: never set
Corresponds to the JSON property
hasImages
1999 2000 2001 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 1999 def has_images @has_images end |
#labels ⇒ Array<Google::Apis::ToolresultsV1beta3::StepLabelsEntry>
Arbitrary user-supplied key/value pairs that are associated with the step. Users are responsible for managing the key namespace such that keys don't accidentally collide. An INVALID_ARGUMENT will be returned if the number of labels exceeds 100 or if the length of any of the keys or values exceeds 100 characters.
- In response: always set - In create request: optional - In update request:
optional; any new key/value pair will be added to the map, and any new value
for an existing key will update that key's value
Corresponds to the JSON property
labels
2012 2013 2014 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2012 def labels @labels end |
#name ⇒ String
A short human-readable name to display in the UI. Maximum of 100 characters. For example: Clean build A PRECONDITION_FAILED will be returned upon creating a new step if it shares its name and dimension_value with an existing step. If two steps represent a similar action, but have different dimension values, they should share the same name. For instance, if the same set of tests is run on two different platforms, the two steps should have the same name.
- In response: always set - In create request: always set - In update request:
never set
Corresponds to the JSON property
name
2025 2026 2027 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2025 def name @name end |
#outcome ⇒ Google::Apis::ToolresultsV1beta3::Outcome
Interprets a result so that humans and machines can act on it.
Corresponds to the JSON property outcome
2030 2031 2032 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2030 def outcome @outcome end |
#run_duration ⇒ Google::Apis::ToolresultsV1beta3::Duration
A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +- 10,000 years.
Examples
Example 1: Compute Duration from two Timestamps in pseudo code.
Timestamp start = ...; Timestamp end = ...; Duration duration = ...;
duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos -
start.nanos;
if (duration.seconds 0) duration.seconds += 1; duration.nanos -= 1000000000;
else if (durations.seconds > 0 && duration.nanos < 0) duration.seconds -=
1; duration.nanos += 1000000000;
Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
Timestamp start = ...; Duration duration = ...; Timestamp end = ...;
end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos +
duration.nanos;
if (end.nanos = 1000000000) end.seconds += 1; end.nanos -= 1000000000;
Example 3: Compute Duration from datetime.timedelta in Python.
td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.
FromTimedelta(td)
JSON Mapping
In JSON format, the Duration type is encoded as a string rather than an object,
where the string ends in the suffix "s" (indicating seconds) and is preceded
by the number of seconds, with nanoseconds expressed as fractional seconds.
For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "
3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.
000000001s", and 3 seconds and 1 microsecond should be expressed in JSON
format as "3.000001s".
Corresponds to the JSON property runDuration
2064 2065 2066 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2064 def run_duration @run_duration end |
#state ⇒ String
The initial state is IN_PROGRESS. The only legal state transitions are * IN_PROGRESS -> COMPLETE A PRECONDITION_FAILED will be returned if an invalid transition is requested. It is valid to create Step with a state set to COMPLETE. The state can only be set to COMPLETE once. A PRECONDITION_FAILED will be returned if the state is set to COMPLETE multiple times.
- In response: always set - In create/update request: optional
Corresponds to the JSON property
state
2075 2076 2077 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2075 def state @state end |
#step_id ⇒ String
A unique identifier within a Execution for this Step. Returns INVALID_ARGUMENT if this field is set or overwritten by the caller.
- In response: always set - In create/update request: never set
Corresponds to the JSON property
stepId
2082 2083 2084 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2082 def step_id @step_id end |
#test_execution_step ⇒ Google::Apis::ToolresultsV1beta3::TestExecutionStep
A step that represents running tests.
It accepts ant-junit xml files which will be parsed into structured test
results by the service. Xml file paths are updated in order to append more
files, however they can't be deleted.
Users can also add test results manually by using the test_result field.
Corresponds to the JSON property testExecutionStep
2091 2092 2093 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2091 def test_execution_step @test_execution_step end |
#tool_execution_step ⇒ Google::Apis::ToolresultsV1beta3::ToolExecutionStep
Generic tool step to be used for binaries we do not explicitly support. For
example: running cp to copy artifacts from one location to another.
Corresponds to the JSON property toolExecutionStep
2097 2098 2099 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2097 def tool_execution_step @tool_execution_step end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 |
# File 'generated/google/apis/toolresults_v1beta3/classes.rb', line 2104 def update!(**args) @completion_time = args[:completion_time] if args.key?(:completion_time) @creation_time = args[:creation_time] if args.key?(:creation_time) @description = args[:description] if args.key?(:description) @device_usage_duration = args[:device_usage_duration] if args.key?(:device_usage_duration) @dimension_value = args[:dimension_value] if args.key?(:dimension_value) @has_images = args[:has_images] if args.key?(:has_images) @labels = args[:labels] if args.key?(:labels) @name = args[:name] if args.key?(:name) @outcome = args[:outcome] if args.key?(:outcome) @run_duration = args[:run_duration] if args.key?(:run_duration) @state = args[:state] if args.key?(:state) @step_id = args[:step_id] if args.key?(:step_id) @test_execution_step = args[:test_execution_step] if args.key?(:test_execution_step) @tool_execution_step = args[:tool_execution_step] if args.key?(:tool_execution_step) end |