Skip to content

Commit 97838c2

Browse files
committed
Some cleanup and fixes to deploy.yml
1 parent dbe880a commit 97838c2

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ jobs:
4141
run: dotnet test --filter FullyQualifiedName!~ExampleTests --no-build --configuration Release --verbosity normal
4242
- name: Pack
4343
if: startsWith(github.ref, 'refs/tags/v')
44-
run: dotnet pack -p:PackageVersion=${{ env.nugetVersion }} --configuration Release -o ${{github.workspace}}/IntelliTect.SelenatePack --no-build
44+
run: dotnet pack -p:PackageVersion=${{ env.nugetVersion }} --configuration Release -o ${{github.workspace}}/IntelliTect.TestToolsPack --no-build
4545
- name: Upload Artifacts
4646
if: startsWith(github.ref, 'refs/tags/v')
4747
uses: actions/upload-artifact@v4
4848
with:
4949
name: NuGet
50-
path: ${{github.workspace}}/IntelliTect.SelenatePack
50+
path: ${{github.workspace}}/IntelliTect.TestToolsPack
5151

5252
deploy:
5353
if: startsWith(github.ref, 'refs/tags/v')
5454
runs-on: ubuntu-latest
5555
needs: build-and-test
5656
environment:
5757
name: 'Production'
58-
url: 'https://www.nuget.org/packages/IntelliTect.TestTools.Selenate'
58+
url: 'https://www.nuget.org/packages/IntelliTect.TestTools.TestFramework'
5959
steps:
6060
- name: Download artifact from build job
6161
uses: actions/download-artifact@v4
@@ -65,11 +65,11 @@ jobs:
6565
run: |
6666
$tagVersion = "${{ github.ref }}".substring(11)
6767
echo "::set-output name=TAG_VERSION::$tagVersion"
68-
dotnet nuget push IntelliTect.Selenate.$tagVersion.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
68+
dotnet nuget push IntelliTect.TestTools.TestFramework.$tagVersion.nupkg --source https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
6969
id: tag-version
7070
- name: Upload nupkg to Releases
7171
uses: softprops/action-gh-release@v2
7272
with:
7373
fail_on_unmatched_files: true
7474
generate_release_notes: true
75-
files: IntelliTect.Selenate.${{ steps.tag-version.outputs.TAG_VERSION }}.nupkg
75+
files: IntelliTect.TestTools.TestFramework.${{ steps.tag-version.outputs.TAG_VERSION }}.nupkg

IntelliTect.TestTools.TestFramework.Tests/TestCaseTests/TestFailureTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async Task DependencyWithMissingDependencyThrowsOriginalError()
4646
public async Task CgiIssue()
4747
{
4848
TestCase tc = new TestBuilder()
49-
.AddAsyncTestBlock<PlaywrightError>()
49+
.AddAsyncTestBlock<AsyncError>()
5050
.Build();
5151

5252
var ex = await Assert.ThrowsAsync<TestCaseException>(() => tc.ExecuteAsync());

IntelliTect.TestTools.TestFramework.Tests/TestData/TestBlocks/SingleDependencyBlocks.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,12 @@ public bool Execute(SomeDependency dep)
7272
}
7373
}
7474

75-
public class PlaywrightError : TestBlock
75+
public class AsyncError : TestBlock
7676
{
7777
public async Task Execute()
7878
{
7979
await Task.Delay(1);
8080
throw new InvalidOperationException("Oops");
81-
//using IPlaywright pw = await Playwright.CreateAsync();
82-
//IAPIRequestContext context = await pw.APIRequest.NewContextAsync();
83-
//await context.GetAsync("http://bad.url.com");
84-
// Playwright exception thrown for ENOTFOUND
8581
}
8682
}
8783
}

IntelliTect.TestTools.TestFramework/TestCase.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,9 @@ public async Task ExecuteAsync()
9494
bool runSuccess = await TryRunBlock(tb, testBlockInstance, executeArgs);
9595
if (!runSuccess)
9696
{
97-
if (TestBlockException is null)
98-
{
99-
TestBlockException = new(
97+
TestBlockException ??= new(
10098
$"Unknown error occurred while running test block {tb}. " +
10199
"Please file an issue: https://github.com/IntelliTect/TestTools.TestFramework/issues");
102-
}
103100
break;
104101
}
105102
}
@@ -122,6 +119,10 @@ public async Task ExecuteAsync()
122119

123120
if (TestBlockException is null)
124121
{
122+
// Note: This likely needs to be moved up above the finally blocks.
123+
// If a test case "passes" i.e. finishes all of its test blocks, we probably need to know that
124+
// in the finally blocks.
125+
// Need to think about how to handle "passed" state if a finally block fails.
125126
Passed = true;
126127
Log?.Info("Test case finished successfully.");
127128
}
@@ -405,14 +406,6 @@ private async Task<bool> TryRunBlock(Block block, object blockInstance, List<obj
405406
() => FinallyBlockExceptions.Add(ex.InnerException)
406407
);
407408
}
408-
catch (ArgumentException ex)
409-
{
410-
HandleFinallyBlock(
411-
block,
412-
() => TestBlockException = ex,
413-
() => FinallyBlockExceptions.Add(ex)
414-
);
415-
}
416409
catch (TargetParameterCountException ex)
417410
{
418411
ex.Data.Add("AdditionalInfo", "Test block failed: Mismatched count between Execute method arguments and supplied dependencies.");

0 commit comments

Comments
 (0)