Skip to content

Commit

Permalink
fix: GO111MODULE broken with go 1.22 update
Browse files Browse the repository at this point in the history
Go no longer support go get outside of a module with the GO111MODULE
enviromental var: https://tip.golang.org/doc/go1.22. Change the uses of
this to go install instead. A version for the modules is required since
it would normally use the go.mod one.
  • Loading branch information
Aflynn50 committed Jul 2, 2024
1 parent b0608ba commit 8dd8b23
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion jobs/ci-run/scripts/centos-unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
fi

# This will be used to generate reports for jenkins.
GO111MODULE=off go get github.com/tebeka/go2xunit
go install github.com/tebeka/go2xunit@latest

cd ${full_path}

Expand Down
24 changes: 12 additions & 12 deletions jobs/ci-run/unittest/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down Expand Up @@ -158,8 +158,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down Expand Up @@ -206,8 +206,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down Expand Up @@ -258,8 +258,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down Expand Up @@ -311,8 +311,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down Expand Up @@ -363,8 +363,8 @@
- apt-install:
packages: gcc squashfuse
- setup-go-environment
- go-get:
modules: github.com/tebeka/go2xunit
- go-install:
modules: github.com/tebeka/go2xunit@latest
- get-s3-source-payload
- description-setter:
description: "${JUJU_VERSION} ${SHORT_GIT_COMMIT}"
Expand Down
4 changes: 2 additions & 2 deletions jobs/common/pre-reqs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
{packages}
- builder:
name: go-get
name: go-install
builders:
- shell: |-
#!/bin/bash
set -eux
GO111MODULE=off go get {modules}
go install {modules}
# install-common-tools installs the common set of tools needed between 99% of
# jobs in this repo. This builder assumes the install target is Ubuntu.
Expand Down
2 changes: 1 addition & 1 deletion jobs/github/scripts/run-snippet-compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ sudo su - "$USER" -c "$(echo "$SAVE_ENV" && cat <<'EOS'
if [ -f "${{WORKSPACE}}/go-unittest.out" ]; then
# This will be used to generate reports for jenkins assuming there is
# a file "go-unittest.out" in the WORKSPACE.
GO111MODULE=off go get -v github.com/tebeka/go2xunit
go install -v github.com/tebeka/go2xunit@latest
"${{GOPATH}}/bin/go2xunit" -fail -input "${{WORKSPACE}}/go-unittest.out" -output "${{WORKSPACE}}/tests.xml"
fi
Expand Down
2 changes: 1 addition & 1 deletion jobs/github/scripts/run-snippet-lxd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ lxc exec "${{CONTAINER_NAME}}" -- sudo -u ubuntu bash <<"EOT"
if [ -f "${{WORKSPACE}}/go-unittest.out" ]; then
# This will be used to generate reports for jenkins assuming there is
# a file "go-unittest.out" in the WORKSPACE.
GO111MODULE=off go get -v github.com/tebeka/go2xunit
go install -v github.com/tebeka/go2xunit@latest
"${{GOPATH}}/bin/go2xunit" -fail -input "${{WORKSPACE}}/go-unittest.out" -output "${{WORKSPACE}}/tests.xml"
fi
Expand Down

0 comments on commit 8dd8b23

Please sign in to comment.