Skip to content
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

enable windows smoke test #2873

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/smoketest-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Go package
run-name: windows test
on:
workflow_dispatch: {}
push: {}
pull_request: {}

jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: Build
run: go run mage.go -v xbuildall
- name: SmokeTest
run: go run mage.go -v testsmoke
34 changes: 29 additions & 5 deletions build/azure-pipelines.pr-automatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ stages:
strategy:
matrix:
# Skip windows smoke tests until we fix the windows agent
#windows:
# poolName: "windows"
# vmImage: ""
# GOMODCACHE: "C:/Users/porterci/go/pkg/mod"
windows:
poolName: "windows"
vmImage: "windows-latest"
GOMODCACHE: "C:/Users/porterci/go/pkg/mod"
linux:
poolName: "Azure Pipelines"
vmImage: "ubuntu-latest"
Expand Down Expand Up @@ -207,6 +207,28 @@ stages:
key: "$(GOMODCACHE_KEY)"
restoreKeys: $(GOMODCACHE_RESTOREKEYS)
path: $(GOMODCACHE)
- task: DockerInstaller@0
displayName: Docker Installer
inputs:
dockerVersion: 24.0.5
releaseType: stable
- task: CmdLine@2
displayName: Validate docker
condition: eq(variables.poolName, 'windows')
inputs:
script: |
docker info
docker -v
docker ps
- task: PowerShell@2
displayName: Validate docker PS
condition: eq(variables.poolName, 'windows')
inputs:
targetType: 'inline'
script: |
docker info
docker -v
docker ps
- task: Cache@2
displayName: Cache Go Build
inputs:
Expand All @@ -215,5 +237,7 @@ stages:
path: $(GOCACHE)
- script: go run mage.go ConfigureAgent UseXBuildBinaries
displayName: "Configure Agent"
- script: mage -v TestSmoke
- script: |
mage -v startdocker
mage -v TestSmoke
displayName: "Run Smoke Tests"
40 changes: 26 additions & 14 deletions build/azure-pipelines.release-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ stages:
strategy:
matrix:
# Skip windows smoke tests until we can fix the windows agent
#windows:
# poolName: "windows"
# vmImage: ""
# GOMODCACHE: "C:/Users/porterci/go/pkg/mod"
windows:
poolName: "windows"
vmImage: "windows-latest"
GOMODCACHE: "C:/Users/porterci/go/pkg/mod"
ludfjig marked this conversation as resolved.
Show resolved Hide resolved
linux:
poolName: "Azure Pipelines"
vmImage: "ubuntu-latest"
Expand All @@ -229,16 +229,28 @@ stages:
key: "$(GOMODCACHE_KEY)"
restoreKeys: $(GOMODCACHE_RESTOREKEYS)
path: $(GOMODCACHE)
- task: Cache@2
displayName: Cache Go Build
inputs:
key: "$(GOCACHE_KEY)"
restoreKeys: $(GOCACHE_RESTOREKEYS)
path: $(GOCACHE)
- script: go run mage.go ConfigureAgent UseXBuildBinaries
displayName: "Setup Bin"
- script: mage -v TestSmoke
displayName: "Run Smoke Tests"
- task: DockerInstaller@0
displayName: Docker Installer
inputs:
dockerVersion: 24.0.5
releaseType: stable
- task: CmdLine@2
displayName: Validate docker
condition: eq(variables.poolName, 'windows')
inputs:
script: |
docker info
docker -v
docker ps
- task: PowerShell@2
displayName: Validate docker PS
condition: eq(variables.poolName, 'windows')
inputs:
targetType: 'inline'
script: |
docker info
docker -v
docker ps

- stage: Publish
dependsOn: Validate
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module get.porter.sh/porter
go 1.20

replace (
// testing for windows
get.porter.sh/magefiles v0.6.0 => github.com/ludfjig/magefiles v0.0.0-20230818183235-007f40840672
// See https://github.com/hashicorp/go-plugin/pull/127 and
// https://github.com/hashicorp/go-plugin/pull/163
// Also includes branches we haven't PR'd yet: capture-yamux-logs, context-cancellation
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
get.porter.sh/magefiles v0.6.0 h1:6F28fuPGBAG9iiXjWzzEIoGG6M29lUEfj6l7Fe/wmv0=
get.porter.sh/magefiles v0.6.0/go.mod h1:KzKenKVauKKDhZ5FERVhqSz8m/xVSsRzOPseDA4UDIE=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0=
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA=
Expand Down Expand Up @@ -562,6 +560,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx
github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/ludfjig/magefiles v0.0.0-20230818183235-007f40840672 h1:iiVjppfnmxhXFWFOnpFEK9LYXhYKNazRie7qiVHOjzM=
github.com/ludfjig/magefiles v0.0.0-20230818183235-007f40840672/go.mod h1:YsSlQWtGoXCGC4pdD7NxPpvh/FryM1bM0wzMWlJC+Bg=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magefile/mage v1.13.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
Expand Down
4 changes: 4 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ func TryRegisterLocalHostAlias() {
}

err := shx.RunV("sudo", "bash", "-c", "echo 127.0.0.1 porter-test-registry >> /etc/hosts")
if runtime.GOOS == "windows" {
err = shx.RunV("cmd.exe", "/c", "echo 127.0.0.1 porter-test-registry >> c:\\Windows\\System32\\drivers\\etc\\hosts")
}

if err != nil {
fmt.Println("skipping registering the porter-test-registry hostname alias: could not write to /etc/hosts")
return
Expand Down
Loading