-
Notifications
You must be signed in to change notification settings - Fork 650
Trying out gha to run tests #7073
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b9706a9
Trying out gha to run tests
davidfowl fc9634a
Use github actions to run tests
davidfowl 8bae5d6
Chanes to run more tests
davidfowl 9d2b49a
Revert the test
davidfowl 5cf4d60
Clean up
davidfowl 594fa1b
Should work
davidfowl f5570a7
Bindmounts seem to be a problem in this environment
davidfowl 6da3471
Fix test
davidfowl 1aa7080
v4 I guess
davidfowl b5dc0af
Install az functions core tools
davidfowl 266ac43
Apply suggestions from code review
davidfowl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Run Integration Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
davidfowl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- project: tests/Aspire.Hosting.Elasticsearch.Tests/Aspire.Hosting.Elasticsearch.Tests.csproj | ||
name: Elasticsearch | ||
- project: tests/Aspire.Hosting.PostgreSQL.Tests/Aspire.Hosting.PostgreSQL.Tests.csproj | ||
name: PostgreSQL | ||
- project: tests/Aspire.Hosting.Oracle.Tests/Aspire.Hosting.Oracle.Tests.csproj | ||
name: Oracle | ||
- project: tests/Aspire.Hosting.Kafka.Tests/Aspire.Hosting.Kafka.Tests.csproj | ||
name: Kafka | ||
- project: tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj | ||
name: Hosting | ||
- project: tests/Aspire.Hosting.Redis.Tests/Aspire.Hosting.Redis.Tests.csproj | ||
name: Redis | ||
- project: tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj | ||
name: Azure | ||
- project: tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj | ||
name: Playground | ||
# Add more projects as needed | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up .NET Core | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
8.x | ||
9.x | ||
|
||
- name: Trust HTTPS development certificate | ||
run: dotnet dev-certs https --trust | ||
|
||
- name: Verify Docker is running | ||
run: docker info | ||
|
||
- name: Install Azure Functions Core Tools | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y azure-functions-core-tools-4 | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ${{ matrix.project }} | ||
|
||
- name: Build projects | ||
run: dotnet build ${{ matrix.project }} /p:CI=false --no-restore | ||
|
||
- name: Run tests | ||
id: run-tests | ||
run: | | ||
dotnet test ${{ matrix.project }} \ | ||
--logger "console;verbosity=normal" \ | ||
--logger "trx" \ | ||
--logger html \ | ||
--blame \ | ||
--blame-hang-timeout 7m \ | ||
--results-directory testresults \ | ||
--no-restore \ | ||
--no-build \ | ||
/p:CI=false | ||
|
||
- name: Compress test results | ||
if: always() | ||
davidfowl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: zip -r testresults.zip testresults | ||
|
||
- name: Upload test results artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: testresults-${{ matrix.name }} | ||
path: testresults.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1497,6 +1497,23 @@ private void PrepareContainers() | |||||||
|
||||||||
foreach (var mount in containerMounts) | ||||||||
{ | ||||||||
if (mount.Type == ContainerMountType.BindMount && | ||||||||
mount.UnixFileMode is not null && | ||||||||
Comment on lines
+1500
to
+1501
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Evaluate the
Suggested change
|
||||||||
!OperatingSystem.IsWindows()) | ||||||||
{ | ||||||||
// REVIEW: Should we know if it's a file or directory? | ||||||||
var source = mount.Source!; | ||||||||
|
||||||||
if (File.Exists(source) || Directory.Exists(source)) | ||||||||
{ | ||||||||
File.SetUnixFileMode(source, mount.UnixFileMode.Value); | ||||||||
} | ||||||||
else if (!Directory.Exists(source)) | ||||||||
{ | ||||||||
Directory.CreateDirectory(source, mount.UnixFileMode.Value); | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
var volumeSpec = new VolumeMount | ||||||||
{ | ||||||||
Source = mount.Source, | ||||||||
|
@@ -1728,7 +1745,7 @@ private async Task CreateContainerAsync(AppResource cr, ILogger resourceLogger, | |||||||
resourceLogger.LogCritical(ex, "Failed to apply container runtime argument '{ConfigKey}'. A dependency may have failed to start.", arg); | ||||||||
_logger.LogDebug(ex, "Failed to apply container runtime argument '{ConfigKey}' to '{ResourceName}'. A dependency may have failed to start.", arg, modelContainerResource.Name); | ||||||||
failedToApplyConfiguration = true; | ||||||||
} | ||||||||
} | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.