Skip to content

Commit

Permalink
Disable flakey CI tests that block open PR's (#2359)
Browse files Browse the repository at this point in the history
* Disable flakey CI tests that block open PR's

* reformat

* reformat

* disable profiler tests for now as well
  • Loading branch information
Mpdreamz authored May 22, 2024
1 parent 8e81ab1 commit 1c3dcb8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ jobs:

azure-tests:
runs-on: ubuntu-latest
if: |
github.event_name != 'pull_request'
|| github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
if: ${{ false }}
#if: |
# github.event_name != 'pull_request'
# || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
profiler-tests:
runs-on: windows-2022
# Disable profiler tests for now
# if: ${{ false }}
if: ${{ false }}
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
Expand Down
13 changes: 13 additions & 0 deletions test/Elastic.Apm.Tests.Utilities/XUnit/DisabledTestFact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System;
using Xunit;

namespace Elastic.Apm.Tests.Utilities.XUnit;
Expand All @@ -16,3 +17,15 @@ public DisabledTestFact(string reason, string issueLink = null)
Skip += $", issue link: {issueLink}";
}
}

public sealed class FlakyCiTestFact : FactAttribute
{
public FlakyCiTestFact(int issueNumber)
{
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CI")))
return;

var issueLink = $"https://github.com/elastic/apm-agent-dotnet/issues/{issueNumber}";
Skip = $"Flaky test on CI see: {issueLink}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using Elastic.Apm.Model;
using Elastic.Apm.Tests.Utilities.XUnit;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -56,7 +57,7 @@ public async Task AccessBaggageFromUpstream()
///
/// The test makes sure that the agent in the 2. service captures the baggage added by the 1. service.
/// </summary>
[Fact]
[FlakyCiTestFact(2358)]
public async Task MultipleServices()
{
var client = new HttpClient();
Expand Down

0 comments on commit 1c3dcb8

Please sign in to comment.