Skip to content

Commit

Permalink
Fix TestItemResponse model. (#119)
Browse files Browse the repository at this point in the history
* Replaced IsRetry by Retries property.
  • Loading branch information
Aleh-Yanushkevich authored Apr 22, 2023
1 parent d8132b1 commit bc3a928
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public class TestItemResponse
[JsonConverter(typeof(NullableDateTimeUnixEpochConverter))]
public DateTime? EndTime { get; set; }

[JsonPropertyName("retry")]
public bool IsRetry { get; set; }
public IEnumerable<TestItemResponse> Retries { get; set; }

[JsonConverter(typeof(JsonStringEnumConverterEx<Status>))]
public Status Status { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ public async Task RetryTest()
await Service.TestItem.FinishAsync(secondAttempt.Uuid, new FinishTestItemRequest
{
EndTime = DateTime.UtcNow,
//IsRetry = true
});

await Service.TestItem.FinishAsync(suite.Uuid, new FinishTestItemRequest
Expand All @@ -705,7 +704,13 @@ public async Task RetryTest()

var launch = await Service.Launch.GetAsync(_fixture.LaunchId);

Assert.True(launch.HasRetries);
var retriedTestItem = await Service.TestItem.GetAsync(secondAttempt.Uuid);
var originalTestItem = await Service.TestItem.GetAsync(firstAttempt.Uuid);

retriedTestItem.Retries.Should().BeEquivalentTo(new[] { originalTestItem },
because: "retried test item should have information about original test item execution");

launch.HasRetries.Should().BeTrue(because: "launch has retried test item");
}

[Fact]
Expand Down

0 comments on commit bc3a928

Please sign in to comment.