Skip to content

Commit

Permalink
Allow manual workflow dispatch (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko authored Oct 17, 2023
1 parent e32d461 commit 75155f7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CI

on: push
on:
- push
- workflow_dispatch

env:
CONFIGURATION: Release
Expand Down
15 changes: 1 addition & 14 deletions test/ReportPortal.Client.IntegrationTests/BaseFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,7 @@ public BaseFixture()

var uiToken = JsonSerializer.Deserialize<TokenModel>(uiTokenJson);

using (var apiTokenRequestMessage = new HttpRequestMessage(HttpMethod.Get, "uat/sso/me/apitoken"))
{
apiTokenRequestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", uiToken.AccessToken);
using (var apiTokenResponseMessage = httpClient.SendAsync(apiTokenRequestMessage).GetAwaiter().GetResult())
{
apiTokenResponseMessage.EnsureSuccessStatusCode();

var apiTokenJson = apiTokenResponseMessage.Content.ReadAsStringAsync().GetAwaiter().GetResult();

var apiToken = JsonSerializer.Deserialize<TokenModel>(apiTokenJson);

Service = new Service(new Uri($"{url}/api/v1"), ProjectName, apiToken.AccessToken);
}
}
Service = new Service(new Uri($"{url}/api/v1"), ProjectName, uiToken.AccessToken);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using FluentAssertions;
using ReportPortal.Client.Abstractions.Requests;
using ReportPortal.Client.Abstractions.Responses;
using System;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -36,10 +37,13 @@ public async Task StartFinishDeleteLaunch()
var message = await Service.AsyncLaunch.FinishAsync(launch.Uuid, finishLaunchRequest);
Assert.Equal(launch.Uuid, message.Uuid);

// race condition: get a chance the launch is in database before deleting it
await Task.Delay(1000);
LaunchResponse gotLaunch = null;

var gotLaunch = await Service.Launch.GetAsync(launch.Uuid);
// wait until async launch will be processed
Func<Task> getLaunchAction = async () => gotLaunch = await Service.Launch.GetAsync(launch.Uuid);
await getLaunchAction.Should().NotThrowAfterAsync(TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(1));

Assert.NotNull(gotLaunch);
Assert.Equal("StartFinishDeleteAsyncLaunch", gotLaunch.Name);
gotLaunch.StartTime.Should().BeCloseTo(startLaunchRequest.StartTime, precision: 1);
gotLaunch.EndTime.Should().BeCloseTo(finishLaunchRequest.EndTime, precision: 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net48;netcoreapp3.1;</TargetFrameworks>
<TargetFrameworks>net6.0;net48;</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

Expand Down

0 comments on commit 75155f7

Please sign in to comment.