mirror of https://github.com/helm/helm.git
Merge pull request #30928 from TerryHowe/fix-plugin-install-no-internet
build-test / build (push) Waiting to run
Details
CodeQL / Analyze (go) (push) Waiting to run
Details
golangci-lint / golangci-lint (push) Waiting to run
Details
release / release (push) Waiting to run
Details
release / canary-release (push) Waiting to run
Details
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Details
build-test / build (push) Waiting to run
Details
CodeQL / Analyze (go) (push) Waiting to run
Details
golangci-lint / golangci-lint (push) Waiting to run
Details
release / release (push) Waiting to run
Details
release / canary-release (push) Waiting to run
Details
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Details
fix: plugin installer test with no Internet
This commit is contained in:
commit
d4e58c54ba
|
@ -19,6 +19,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/Masterminds/vcs"
|
||||
|
@ -119,6 +120,8 @@ func TestVCSInstallerNonExistentVersion(t *testing.T) {
|
|||
|
||||
if err := Install(i); err == nil {
|
||||
t.Fatalf("expected error for version does not exists, got none")
|
||||
} else if strings.Contains(err.Error(), "Could not resolve host: github.com") {
|
||||
t.Skip("Unable to run test without Internet access")
|
||||
} else if err.Error() != fmt.Sprintf("requested version %q does not exist for plugin %q", version, source) {
|
||||
t.Fatalf("expected error for version does not exists, got (%v)", err)
|
||||
}
|
||||
|
@ -146,7 +149,11 @@ func TestVCSInstallerUpdate(t *testing.T) {
|
|||
|
||||
// Install plugin before update
|
||||
if err := Install(i); err != nil {
|
||||
t.Fatal(err)
|
||||
if strings.Contains(err.Error(), "Could not resolve host: github.com") {
|
||||
t.Skip("Unable to run test without Internet access")
|
||||
} else {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Test FindSource method for positive result
|
||||
|
|
Loading…
Reference in New Issue