Skip to content

Commit

Permalink
Merge #11250 #11296
Browse files Browse the repository at this point in the history
11250: ci: Move more tests to linux-only integration tests r=AaronFriel a=AaronFriel

Reduces the set of smoke tests run on Windows & macOS, balances the reduced parallelism #11249 by moving tests which don't seem to obviously entail cross-platform behavior changes. The tests moved to only run on Linux environments are listed below and except for the first, all were split from `integration_test.go`.

* `TestRefreshGo` checks that the Pulumi.yaml `options.refresh` option is obeyed (moved to integration_go_test from integration_go_smoke_test)
* `TestStackTagValidation` which tests Pulumi.yaml validation
* `TestStackInitValidation` which tests an error on running `pulumi stack init`
* `TestConfigPaths` which tests `pulumi config set` under a wide variety of inputs
* `TestDestroyStackRef` which tests running `pulumi destroy` on a stack with a large stack reference
* `TestJSONOutput` which tests output JSON output diagnostics
* `TestExcludeProtected` which tests behavior around marking resources protected
* `TestProviderDownloadURL` which tests the `PluginDownloadURL` resource option, but does not actually perform plugin acquisition.

These tests either didn't seem to be obviously platform specific or there was a narrower test could verify that parsing and handling the same files worked correctly. As examples of those, the remaining tests that will run on smoke tests (all platforms) are:

* `TestConfigSave` which tests `pulumi config set` and stack config parsing
* `TestRotatePassphrase` which tests changing the local secrets provider passphrase via stdin - which hypothetically could vary across platforms
* `TestJSONOutputWithStreamingPreview` tests streaming output and event capturing
* `TestPassphrasePrompting` tests stdin/stdout behavior in prompting for passphrases.

Lastly, the `TestProviderDownloadURL` test was modified to ensure we wouldn't make requests to uncontrolled third party URLs. Though the tests don't acquire plugins, we don't control "get.com", so the `.test` TLD is used to ensure test behavior cannot depend on that domain.

11296: Update YAML to 1.0.2 r=AaronFriel a=AaronFriel



Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
  • Loading branch information
bors[bot] and AaronFriel committed Nov 9, 2022
3 parents daad9b6 + 28b1ae2 + 22653aa commit d13f47a
Show file tree
Hide file tree
Showing 18 changed files with 851 additions and 677 deletions.
4 changes: 4 additions & 0 deletions changelog/pending/20221108--yaml1-0-2.yaml
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: yaml
description: "[Updates Pulumi YAML to v1.0.2](https://github.com/pulumi/pulumi-yaml/releases/tag/v1.0.2) which fixes a bug encountered using templates with project level config."
2 changes: 1 addition & 1 deletion pkg/go.mod
Expand Up @@ -68,7 +68,7 @@ require (
github.com/muesli/cancelreader v0.2.2
github.com/natefinch/atomic v1.0.1
github.com/pulumi/pulumi-java/pkg v0.6.0
github.com/pulumi/pulumi-yaml v1.0.1
github.com/pulumi/pulumi-yaml v1.0.2
github.com/rivo/uniseg v0.2.0
github.com/segmentio/encoding v0.3.5
github.com/shirou/gopsutil/v3 v3.22.3
Expand Down
4 changes: 2 additions & 2 deletions pkg/go.sum
Expand Up @@ -1471,8 +1471,8 @@ github.com/prometheus/prometheus v0.37.0/go.mod h1:egARUgz+K93zwqsVIAneFlLZefyGO
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi-java/pkg v0.6.0 h1:haiSQJlhrQIBBcR0r0aQCIF8i69e4znzRnHpaNQUchE=
github.com/pulumi/pulumi-java/pkg v0.6.0/go.mod h1:xSK2B792P8zjwYZTHYapMM1RJdue2BpRFQNYObWO0C8=
github.com/pulumi/pulumi-yaml v1.0.1 h1:P+txHPqaRd1b8Pf8vLJ1fQZTjmwFp1FDo9mCmuxI+6A=
github.com/pulumi/pulumi-yaml v1.0.1/go.mod h1:vxV5TdH3Xk5HRHNftcDXSbsZFJcJY9ME6k4zD+xw9OY=
github.com/pulumi/pulumi-yaml v1.0.2 h1:8fuoFNJlYJm1ni1Fff8QsIvef3E+ilroTPDrYKyy088=
github.com/pulumi/pulumi-yaml v1.0.2/go.mod h1:FKly+y0x5onXHEZALNnFglr6ZZnro4Y/jlN4sYLKYeM=
github.com/pulumi/ssh-agent v0.5.1 h1:7DT4FcZNHWBAp9BFI+k0+HeBYGWbJvilJ29ra/4FlRM=
github.com/pulumi/ssh-agent v0.5.1/go.mod h1:e6cyz/FUcE3PcJZ0tiuygkRsnHnCZcSQoQU+APbnrVA=
github.com/rakyll/embedmd v0.0.0-20171029212350-c8060a0752a2/go.mod h1:7jOTMgqac46PZcF54q6l2hkLEG8op93fZu61KmxWDV4=
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/gather_plugin/dotnet/MyStack.cs
Expand Up @@ -7,10 +7,10 @@ public MyStack()
// Create an AWS resource (S3 Bucket)
var r = new Random(
"default", 10, new ComponentResourceOptions{
PluginDownloadURL = "get.com",
PluginDownloadURL = "get.example.test",
});
var provider = new Provider("explicit", new CustomResourceOptions{
PluginDownloadURL = "get.pulumi/test/providers",
PluginDownloadURL = "get.pulumi.test/providers",
});
var e = new Random("explicit", 8, new ComponentResourceOptions{
Provider = provider,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/gather_plugin/go/main.go
Expand Up @@ -14,13 +14,13 @@ func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
r, err := NewRandom(ctx, "default", &RandomArgs{
Length: pulumi.Int(10),
}, pulumi.PluginDownloadURL("get.com"))
}, pulumi.PluginDownloadURL("get.example.test"))
if err != nil {
return err
}

provider, err := NewProvider(ctx, "explicit",
pulumi.PluginDownloadURL("get.pulumi/test/providers"))
pulumi.PluginDownloadURL("get.pulumi.test/providers"))
e, err := NewRandom(ctx, "explicit", &RandomArgs{
Length: pulumi.Int(8),
}, pulumi.Provider(provider))
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/gather_plugin/nodejs/index.ts
Expand Up @@ -17,12 +17,12 @@ class RandomProvider extends pulumi.ProviderResource {
}

const r = new Random("default", 10, {
pluginDownloadURL: "get.com",
pluginDownloadURL: "get.example.test",
});
export const defaultProvider = r.result;

const provider = new RandomProvider("explicit", {
pluginDownloadURL: "get.pulumi/test/providers",
pluginDownloadURL: "get.pulumi.test/providers",
});

new Random("explicit", 8, { provider: provider });
4 changes: 2 additions & 2 deletions tests/integration/gather_plugin/python/__main__.py
Expand Up @@ -18,8 +18,8 @@ class RandomProvider(Provider):
def __init__(self, opts: Optional[ResourceOptions]=None):
Provider.__init__(self, "testprovider", "provider", None, opts)

example_url = ResourceOptions(plugin_download_url="get.com")
provider_url = ResourceOptions(plugin_download_url="get.pulumi/test/providers")
example_url = ResourceOptions(plugin_download_url="get.example.test")
provider_url = ResourceOptions(plugin_download_url="get.pulumi.test/providers")

# Create resource with specified PluginDownloadURL
r = Random("default", length=10, opts=example_url)
Expand Down
15 changes: 14 additions & 1 deletion tests/integration/integration_dotnet_smoke_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2020, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build dotnet || all

package ints
Expand Down
15 changes: 14 additions & 1 deletion tests/integration/integration_dotnet_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2020, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (dotnet || all) && !smoke

package ints
Expand Down
26 changes: 14 additions & 12 deletions tests/integration/integration_go_smoke_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go || all

package ints
Expand Down Expand Up @@ -162,14 +175,3 @@ func optsForConstructGo(t *testing.T, dir string, expectedResourceCount int, loc
},
}
}

// TestRefreshGo simply tests that we can build and run an empty Go project with the `refresh` option set.
func TestRefreshGo(t *testing.T) {
integration.ProgramTest(t, &integration.ProgramTestOptions{
Dir: filepath.Join("refresh", "go"),
Dependencies: []string{
"github.com/pulumi/pulumi/sdk/v3",
},
Quick: true,
})
}
26 changes: 25 additions & 1 deletion tests/integration/integration_go_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (go || all) && !smoke

package ints
Expand Down Expand Up @@ -787,3 +800,14 @@ func TestProjectMainGo(t *testing.T) {
}
integration.ProgramTest(t, &test)
}

// TestRefreshGo simply tests that we can build and run an empty Go project with the `refresh` option set.
func TestRefreshGo(t *testing.T) {
integration.ProgramTest(t, &integration.ProgramTestOptions{
Dir: filepath.Join("refresh", "go"),
Dependencies: []string{
"github.com/pulumi/pulumi/sdk/v3",
},
Quick: true,
})
}
15 changes: 14 additions & 1 deletion tests/integration/integration_nodejs_smoke_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2022, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build nodejs || all

package ints
Expand Down
15 changes: 14 additions & 1 deletion tests/integration/integration_nodejs_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2022, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (nodejs || all) && !smoke

package ints
Expand Down
15 changes: 14 additions & 1 deletion tests/integration/integration_python_smoke_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build python || all

package ints
Expand Down
15 changes: 14 additions & 1 deletion tests/integration/integration_python_test.go
@@ -1,4 +1,17 @@
// Copyright 2016-2021, Pulumi Corporation. All rights reserved.
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build (python || all) && !smoke

package ints
Expand Down

0 comments on commit d13f47a

Please sign in to comment.