mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-19 06:21:41 -04:00
backport of commit 4f54212560
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package packer_test
|
||||
|
||||
func (ts *PackerTestSuite) TestPackerInitForce() {
|
||||
ts.SkipNoAcc()
|
||||
|
||||
pluginPath, cleanup := ts.MakePluginDir()
|
||||
defer cleanup()
|
||||
|
||||
@@ -18,6 +20,8 @@ func (ts *PackerTestSuite) TestPackerInitForce() {
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestPackerInitUpgrade() {
|
||||
ts.SkipNoAcc()
|
||||
|
||||
pluginPath, cleanup := ts.MakePluginDir()
|
||||
defer cleanup()
|
||||
|
||||
@@ -62,6 +66,8 @@ func (ts *PackerTestSuite) TestPackerInitWithNonGithubSource() {
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestPackerInitWithMixedVersions() {
|
||||
ts.SkipNoAcc()
|
||||
|
||||
pluginPath, cleanup := ts.MakePluginDir()
|
||||
defer cleanup()
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ func (ts *PackerTestSuite) TestInstallPluginPrerelease() {
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestRemoteInstallWithPluginsInstall() {
|
||||
ts.SkipNoAcc()
|
||||
|
||||
pluginPath, cleanup := ts.MakePluginDir()
|
||||
defer cleanup()
|
||||
|
||||
@@ -80,6 +82,8 @@ func (ts *PackerTestSuite) TestRemoteInstallWithPluginsInstall() {
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestRemoteInstallOfPreReleasePlugin() {
|
||||
ts.SkipNoAcc()
|
||||
|
||||
pluginPath, cleanup := ts.MakePluginDir()
|
||||
defer cleanup()
|
||||
|
||||
|
||||
@@ -42,6 +42,20 @@ func (ts *PackerTestSuite) buildPluginBinaries(t *testing.T) {
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
// SkipNoAcc is a pre-condition that skips the test if the PACKER_ACC environment
|
||||
// variable is unset, or set to "0".
|
||||
//
|
||||
// This allows us to build tests with a potential for long runs (or errors like
|
||||
// rate-limiting), so we can still test them, but only in a longer timeouted
|
||||
// context.
|
||||
func (ts *PackerTestSuite) SkipNoAcc() {
|
||||
acc := os.Getenv("PACKER_ACC")
|
||||
if acc == "" || acc == "0" {
|
||||
ts.T().Logf("Skipping test as `PACKER_ACC` is unset.")
|
||||
ts.T().Skip()
|
||||
}
|
||||
}
|
||||
|
||||
func Test_PackerCoreSuite(t *testing.T) {
|
||||
ts := &PackerTestSuite{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user