-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since v6.62.1 minimal schema was not working. This is now fixed. A change in standard CI scripts aimed at speeding up makefiles broke the assumptions of pulumi-aws specific Makefile extensions in .mk/minimal_schema.mk - that is CI would now run `make --touch provider schema` which would create an empty provider/cmd/pulumi-resource-aws/schema-minimal-embed.json file instead of recalculating it. The change in question is: pulumi/ci-mgmt#1157 The fix makes `minimal_schema` a PHONY target that may be a bit less efficient for rebuilding but is no longer affected by `make --touch`. A regression test is added to catch this problem should it reoccur. Fixes #5016
- Loading branch information
Showing
2 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2016-2024, Pulumi Corporation. All rights reserved. | ||
//go:build nodejs || all | ||
// +build nodejs all | ||
|
||
package examples | ||
|
||
import ( | ||
"bytes" | ||
"encoding/json" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/pulumi/pulumi/pkg/v3/codegen/schema" | ||
"github.com/pulumi/pulumi/pkg/v3/codegen/testing/utils" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestMinimalSchema(t *testing.T) { | ||
var buf bytes.Buffer | ||
schemaSource := filepath.Join("..", "bin", "pulumi-resource-aws") | ||
t.Logf("pulumi package get-schema %s", schemaSource) | ||
cmd := exec.Command("pulumi", "package", "get-schema", schemaSource) | ||
cmd.Env = append(os.Environ(), "PULUMI_AWS_MINIMAL_SCHEMA=true") | ||
cmd.Stdout = &buf | ||
err := cmd.Run() | ||
cmd.Stderr = os.Stderr | ||
if err != nil { | ||
t.Logf("%s", buf.String()) | ||
require.NoError(t, err) | ||
} | ||
var packageSpec schema.PackageSpec | ||
err = json.Unmarshal(buf.Bytes(), &packageSpec) | ||
require.NoError(t, err) | ||
t.Logf("Parsed minimal schema") | ||
loader := schema.NewPluginLoader(utils.NewHostWithProviders(t.TempDir())) | ||
_, diags, err := schema.BindSpec(packageSpec, loader) | ||
require.NoError(t, err) | ||
for _, d := range diags { | ||
t.Logf("sev=%v summary: %s\n detail: %s", d.Severity, d.Summary, d.Detail) | ||
} | ||
require.False(t, diags.HasErrors()) | ||
t.Logf("Validated minimal schema") | ||
} |