Skip to content

Commit

Permalink
Refactor cmd/rigtest into a real test suite in test/rig_test.go and f…
Browse files Browse the repository at this point in the history
…ix found bugs (#145)

* Convert cmd/rigtest into a real test in test/rig_test.go

Signed-off-by: Kimmo Lehto <[email protected]>

* Adjust workflows/test scripts for test/rig_test.go

Signed-off-by: Kimmo Lehto <[email protected]>

* Fix bugs found by the new improved tests

Signed-off-by: Kimmo Lehto <[email protected]>

---------

Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke authored Jan 2, 2024
1 parent afaa2d5 commit 10f783d
Show file tree
Hide file tree
Showing 28 changed files with 1,938 additions and 1,513 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:

build-linux:
unit-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand All @@ -13,13 +13,11 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
run: |
go mod download
go test -v ./...
integration-linux:
strategy:
Expand All @@ -29,7 +27,7 @@ jobs:
- quay.io/k0sproject/bootloose-ubuntu20.04
- quay.io/k0sproject/bootloose-debian12
- quay.io/k0sproject/bootloose-alpine3.18
needs: build-linux
needs: unit-linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +36,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true

- name: install test dependencies
run: |
Expand All @@ -48,12 +45,16 @@ jobs:
- name: Run integration tests
env:
LINUX_IMAGE: ${{ matrix.image }}
run: make -C test test
run: |
cd test
go mod download
make test
windows:
runs-on: windows-2022
steps:
- name: Set up WinRM
shell: pwsh
run: |
Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $True
Get-ChildItem WSMan:\Localhost\listener | Remove-Item -Recurse
Expand Down Expand Up @@ -102,16 +103,14 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Test
run: go test -v ./...

- name: Build rigtest
run: |
go install ./cmd/rigtest
rigtest --help

- name: Run rigtest
- name: Unit test
run: |
go mod download
go test -v ./...
- name: Integration test
run: |
rigtest.exe -proto winrm -host 127.0.0.1:5986 -user winrmuser -pass Password123 -https
cd test
go mod download
go test -v ./ -args -protocol winrm -host 127.0.0.1 -port 5986 -user winrmuser -winrm-password Password123 -winrm-https
Loading

0 comments on commit 10f783d

Please sign in to comment.