-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b7cd26
commit 0d8f546
Showing
1 changed file
with
29 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -17,7 +17,10 @@ jobs: | |
- name: Test the PowerShell module instructions from README.md | ||
shell: powershell | ||
run: | | ||
dotnet build -c Release ./test/test-applications/integrations/TestApplication.Smoke/TestApplication.Smoke.csproj | ||
mkdir testapp | ||
cd testapp | ||
dotnet new console | ||
dotnet publish -f net7.0 -c Release | ||
$module_url = "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/OpenTelemetry.DotNet.Auto.psm1" | ||
$dl_path = Join-Path $env:temp "OpenTelemetry.DotNet.Auto.psm1" | ||
$log_path = "C:\ProgramData\OpenTelemetry .NET AutoInstrumentation\logs\*" | ||
|
@@ -26,12 +29,12 @@ jobs: | |
Install-OpenTelemetryCore | ||
$install_dir = Get-OpenTelemetryInstallDirectory | ||
Register-OpenTelemetryForCurrentSession -OTelServiceName "MyServiceDisplayName" | ||
./test/test-applications/integrations/TestApplication.Smoke/bin/Release/net7.0/TestApplication.Smoke.exe | ||
./bin/Release/net7.0/publish/testapp | ||
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" } | ||
if (-not (Test-Path $log_path)) { throw "Log file does not exist. Instrumentation test failed." } | ||
Remove-Item $log_path | ||
Unregister-OpenTelemetryForCurrentSession | ||
./test/test-applications/integrations/TestApplication.Smoke/bin/Release/net7.0/TestApplication.Smoke.exe | ||
./bin/Release/net7.0/publish/testapp | ||
if (-not $?) { throw "dotnet help returned exit code: $LASTEXITCODE" } | ||
if (Test-Path $log_path) { throw "Log file exists. Instrumentation unregister failed." } | ||
Uninstall-OpenTelemetryCore | ||
|
@@ -64,13 +67,16 @@ jobs: | |
shell: bash | ||
run: | | ||
set -e | ||
dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke | ||
mkdir testapp | ||
cd testapp | ||
dotnet new console | ||
dotnet publish -f net7.0 -c Release | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/otel-dotnet-auto-install.sh -O | ||
sh ./otel-dotnet-auto-install.sh | ||
test "$(ls -A "$HOME/.otel-dotnet-auto")" | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/instrument.sh -O | ||
. ./instrument.sh | ||
./test/test-applications/integrations/TestApplication.Smoke/bin/Release/net7.0/publish/TestApplication.Smoke | ||
./bin/Release/net7.0/publish/testapp | ||
test "$(ls -A '${{ matrix.log-dir }}' )" | ||
shell-scripts-container: | ||
|
@@ -80,19 +86,22 @@ jobs: | |
base-image: [ alpine ] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Test the Shell scripts from README.md in Docker container | ||
run: | | ||
set -e | ||
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . | ||
docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c ' | ||
- uses: actions/[email protected] | ||
- name: Test the Shell scripts from README.md in Docker container | ||
run: | | ||
set -e | ||
dotnet publish -f net7.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/otel-dotnet-auto-install.sh -O | ||
sh ./otel-dotnet-auto-install.sh | ||
test "$(ls -A "$HOME/.otel-dotnet-auto")" | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/instrument.sh -O | ||
. ./instrument.sh | ||
./test/test-applications/integrations/TestApplication.Smoke/bin/Release/net7.0/publish/TestApplication.Smoke | ||
test "$(ls -A /var/log/opentelemetry/dotnet )" | ||
' | ||
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" . | ||
docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c ' | ||
set -e | ||
mkdir testapp | ||
cd testapp | ||
dotnet new console | ||
dotnet publish -f net7.0 -c Release | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/otel-dotnet-auto-install.sh -O | ||
sh ./otel-dotnet-auto-install.sh | ||
test "$(ls -A "$HOME/.otel-dotnet-auto")" | ||
curl -sSfL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/instrument.sh -O | ||
. ./instrument.sh | ||
./bin/Release/net7.0/publish/testapp | ||
test "$(ls -A /var/log/opentelemetry/dotnet )" | ||
' |