Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manual workflow dispatch #126

Merged
merged 6 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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