-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add a workflow to test otelcorecol as a Windows service #9689
Merged
dmitryax
merged 4 commits into
open-telemetry:main
from
pjanotti:add-windows-service-test
Mar 6, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2f75e8f
Add a workflow to test otelcorecol as a Windows service
pjanotti b1b0014
Merge branch 'main' into add-windows-service-test
pjanotti 9dea496
Merge branch 'main' into add-windows-service-test
pjanotti 4fdae4e
Merge branch 'main' into add-windows-service-test
pjanotti 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 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 |
---|---|---|
|
@@ -35,3 +35,41 @@ jobs: | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
- name: Run Unit Tests | ||
run: make gotest | ||
|
||
windows-service-test: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: ~1.21.5 | ||
cache: false | ||
- name: Cache Go | ||
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | ||
env: | ||
cache-name: cache-go-modules | ||
with: | ||
path: | | ||
~\go\pkg\mod | ||
~\AppData\Local\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Make otelcorecol | ||
run: make otelcorecol | ||
|
||
- name: Install otelcorecol as a service | ||
run: | | ||
New-Service -Name "otelcorecol" -BinaryPathName "${PWD}\bin\otelcorecol_windows_amd64 --config ${PWD}\examples\local\otel-config.yaml" | ||
eventcreate.exe /t information /id 1 /l application /d "Creating event provider for 'otelcorecol'" /so otelcorecol | ||
|
||
- name: Test otelcorecol service | ||
run: | | ||
(Start-Service otelcorecol -PassThru).WaitForStatus('Running', '00:00:30') | ||
(Stop-Service otelcorecol -PassThru).WaitForStatus('Stopped', '00:00:30') | ||
Comment on lines
+67
to
+70
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. When implementing #5300 I will switch this to a golang test. |
||
|
||
- name: Remove otelcorecol service | ||
run: | | ||
Remove-Service otelcorecol | ||
Remove-Item HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Application\otelcorecol |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems repeated in various jobs it seems possible to put all these common steps in a shared action. I will take a look that later.