Skip to content

Commit

Permalink
Merge #11478
Browse files Browse the repository at this point in the history
11478: Fix capitalization for generated `fs.readdirSync` r=iwahbe a=iwahbe

This lets us reenable the `"aws-s3-folder"` programgen test for nodejs.

Co-authored-by: Ian Wahbe <ian@wahbe.com>
  • Loading branch information
bors[bot] and iwahbe committed Nov 29, 2022
2 parents e2e0941 + 9f5e5b5 commit c0b521d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
@@ -0,0 +1,4 @@
changes:
- type: fix
scope: programgen/nodejs
description: Fix capitalization when generating `fs.readdirSync`.
2 changes: 1 addition & 1 deletion pkg/codegen/nodejs/gen_program_expressions.go
Expand Up @@ -429,7 +429,7 @@ func (g *generator) GenFunctionCallExpression(w io.Writer, expr *model.FunctionC
case "readFile":
g.Fgenf(w, "fs.readFileSync(%v)", expr.Args[0])
case "readDir":
g.Fgenf(w, "fs.readDirSync(%v)", expr.Args[0])
g.Fgenf(w, "fs.readdirSync(%v)", expr.Args[0])
case "secret":
g.Fgenf(w, "pulumi.secret(%v)", expr.Args[0])
case "split":
Expand Down
5 changes: 2 additions & 3 deletions pkg/codegen/testing/test/program_driver.go
Expand Up @@ -66,13 +66,12 @@ var PulumiPulumiProgramTests = []ProgramTest{
{
Directory: "aws-s3-folder",
Description: "AWS S3 Folder",
ExpectNYIDiags: allProgLanguages.Except("go"),
SkipCompile: allProgLanguages.Except("dotnet"),
ExpectNYIDiags: codegen.NewStringSet("dotnet", "python"),
SkipCompile: codegen.NewStringSet("go", "python"),
// Blocked on python: TODO[pulumi/pulumi#8062]: Re-enable this test.
// Blocked on go:
// TODO[pulumi/pulumi#8064]
// TODO[pulumi/pulumi#8065]
// Blocked on nodejs: TODO[pulumi/pulumi#8063]
},
{
Directory: "aws-eks",
Expand Down
Expand Up @@ -9,7 +9,7 @@ const siteBucket = new aws.s3.Bucket("siteBucket", {website: {
const siteDir = "www";
// For each file in the directory, create an S3 object stored in `siteBucket`
const files: aws.s3.BucketObject[] = [];
for (const range of fs.readDirSync(siteDir).map((v, k) => ({key: k, value: v}))) {
for (const range of fs.readdirSync(siteDir).map((v, k) => ({key: k, value: v}))) {
files.push(new aws.s3.BucketObject(`files-${range.key}`, {
bucket: siteBucket.id,
key: range.value,
Expand Down

0 comments on commit c0b521d

Please sign in to comment.