Skip to content

Error when testing with the aws-cdk target #7229

Closed
@marciocadev

Description

I tried this:

I try to execute some test pointing to AWS

This happened:

When we run a test pointing to AWS, a failure occurs during the test execution.

$ wing test --platform @winglang/platform-awscdk
⠼ Compiling main.w to awscdk...
[WARNING] aws-cdk-lib.aws_lambda.FunctionOptions#logFormat is deprecated.
  Use `loggingFormat` as a property instead.
⠇ Compiling main.w to awscdk...
[WARNING] aws-cdk-lib.aws_lambda.FunctionOptions#logFormat is deprecated.
  Use `loggingFormat` as a property instead.
✔ Compiling main.w to awscdk...

✔ cdk deploy

✖ Setting up test runner...

"undefined" is not valid JSON
✔ aws-cdk destroy


Tests 1 failed (1)
Snapshots 1 skipped
Test Files 1 failed (1)
Duration 1m14.29s

I expected this:

Running the tests

Is there a workaround?

No

Anything else?

I mapped the error and apparently the issue is with the library import passed wrong format to TestRunnerClient.

const { TestRunnerClient } = await import(
"@winglang/sdk/lib/shared-aws/test-runner.inflight"
);
const runner = new TestRunnerClient(testArns);

Wing Version

0.85.34

Node.js Version

v20.18.1

Platform(s)

Linux

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions