Skip to content

Commit

Permalink
feat: run integration tests on PR (#281)
Browse files Browse the repository at this point in the history
* feat: run integration tests on PR
  • Loading branch information
ShawkyZ authored Jul 9, 2024
1 parent c903156 commit 2f99635
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
outputs:
version: ${{ steps.vsix_version.outputs.next-tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate next semantic version Git tag (vsix version)
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Integration Tests

on:
workflow_dispatch:
workflow_call:
secrets:
TEST_API_TOKEN:
required: true

jobs:
test-vs19:
continue-on-error: true
runs-on: windows-2019
defaults:
run:
working-directory: ${{ github.workspace }}
env:
TEST_API_TOKEN: ${{ secrets.TEST_API_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Setup VSTest
Expand All @@ -26,16 +28,17 @@ jobs:
run: vstest.console.exe **\bin\**\*Integration.Pre22.Tests.dll

test-vs22:
continue-on-error: true
runs-on: windows-2022
defaults:
run:
working-directory: ${{ github.workspace }}
env:
TEST_API_TOKEN: ${{ secrets.TEST_API_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-artifacts
- name: Setup VSTest
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ jobs:
TEST_API_TOKEN: ${{ secrets.TEST_API_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
- name: Tests
run: vstest.console.exe **\*.Tests.dll /TestCaseFilter:"FullyQualifiedName!=Xunit.Instances.VisualStudio&integration!=true" #exclude integration tests and the psuedo-tests that launch a VS instance
run: vstest.console.exe **\*.Tests.dll /TestCaseFilter:"FullyQualifiedName!=Xunit.Instances.VisualStudio&integration!=true" #exclude integration tests and the psuedo-tests that launch a VS instance
run-integration-tests:
needs: build-project
uses: snyk/snyk-visual-studio-plugin/.github/workflows/integration-tests.yml@main
secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
TEST_API_TOKEN: ${{ secrets.TEST_API_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-artifacts

Expand All @@ -51,11 +51,11 @@ jobs:
VsixManifestPath: .\Snyk.VisualStudio.Extension\source.extension.vsixmanifest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: build-artifacts

Expand Down
6 changes: 3 additions & 3 deletions Tests/Integration.Pre22.Tests/Integration.Pre22.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
<Version>0.1.137-beta</Version>
</PackageReference>
<PackageReference Include="System.Collections.Immutable">
<Version>5.0.0</Version>
<Version>8.0.0</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>2.4.2</Version>
<Version>2.5.0</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.5</Version>
<Version>2.5.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 2f99635

Please sign in to comment.