Skip to content

Commit

Permalink
Remove test reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Mar 15, 2024
1 parent de393d0 commit e2e4eb3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
10 changes: 9 additions & 1 deletion .dotnet/tests/TestScenarios/GitHubTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ namespace OpenAI.Tests;
public partial class GitHubTests
{
[Test(Description = "Test that we can use a GitHub secret")]
[Category("GitHub")]
[Category("Online")]
public void CanUseGitHubSecret()
{
string gitHubSecretString = Environment.GetEnvironmentVariable("SECRET_VALUE");
Assert.That(gitHubSecretString, Is.Not.Null.Or.Empty);
}

[Test(Description = "That that we can run some tests without secrets")]
[Category("Offline")]
public void CanTestWithoutSecretAccess()
{
int result = 2 + 1;
Assert.That(result, Is.EqualTo(3));
}
}
2 changes: 0 additions & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ https://docs.github.com/en/actions/automating-builds-and-tests/building-and-test
- Test the built libraries
- Use a repository secret to hold the OpenAI token used for live testing
https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
- To have the test results reported in the Actions UI, we use the test-reporter action
https://github.com/marketplace/actions/test-reporter
- Package the built libraries
- Publish the package as a GitHub Release
- Publish the package to a GitHub NuGet registry
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
pull_request:
types: [opened, reopened, synchronize]

permissions:
actions: read
checks: write
contents: read
packages: write

jobs:
build: # Test, pack and publish the Open AI nuget package as a build artifact
runs-on: ubuntu-latest
Expand All @@ -39,21 +33,12 @@ jobs:
run: dotnet test
--no-build
--configuration Release
--filter="TestCategory~GitHub"
--logger "trx;LogFileName=${{github.workspace}}/artifacts/test-results/github.trx"
--filter="TestCategory~${{ github.event_name == 'pull_request' && 'Offline' || 'Online' }}"
--logger "trx;LogFileName=${{github.workspace}}/artifacts/test-results/full.trx"
env:
SECRET_VALUE: ${{ secrets.REPOSITORY_SECRET }}
SECRET_VALUE: ${{ secrets.OPENAI_TOKEN }}
working-directory: .dotnet

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: dotnet tests # Name of the check run which will be created
path: '**/*.trx' # Path to test results
reporter: dotnet-trx # Format of test results
working-directory: ${{github.workspace}}/artifacts/test-results

- name: Pack
run: dotnet pack
--no-build
Expand Down

0 comments on commit e2e4eb3

Please sign in to comment.