question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are contract tests supposed to be able to handle {{resolve}} as values?

See original GitHub issue

With this input to inputs_1_create.json:

{
  "credentials": {
    "accessToken": "{{resolve:secretsmanager:secretname:SecretString:secertkeyname}}",
    "accountId": "someStringHere"
  },
...
}

I get:

=== Unhandled exception ===
Please report this issue to the team.
Issue tracker: https://github.com/aws-cloudformation/aws-cloudformation-rpdk/issues
Please include the log file 'rpdk.log'

Unfortunately I cannot share this file. But I can see this in it:

Traceback (most recent call last):
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/rpdk/core/cli.py", line 100, in main
    args.command(args)
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/rpdk/core/test.py", line 192, in test
    inputs = get_inputs(
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/rpdk/core/test.py", line 150, in get_inputs
    overrides_raw = render_jinja(
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/rpdk/core/test.py", line 76, in render_jinja
    parsed_content = env.parse(overrides_string)
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/jinja2/environment.py", line 535, in parse
    self.handle_exception(source=source)
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/Users/myusername/.virtualenvs/myenv/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<unknown>", line 3, in template
jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got ':'

What am I doing wrong?

I see that the error is coming from jinja where {{ }} are special characters denoting a variable. If so, how are we expected to hold a public repository which refers to confidential information stored in secrets-manager and needs to override test inputs with such information?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
cmgortoncommented, Oct 17, 2022

Hey @SHxKM. We are working on answering and cleaning up stale issues.

If this is still an unanswered question for you, please feel free to reopen this issue so we can investigate it further.

You can also ask questions in our AWS CloudFormation Discord channel for a more prompt response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saving time with contract testing - DEV Community ‍ ‍
Hi everyone! Today's topic is Contract driven testing. The way we spend our time is important. It is important in our life and...
Read more >
What is Contract Testing & How is it Used? - Pactflow
In a distributed system, integration testing is a process that helps us validate that the various moving parts that communicate remotely – ...
Read more >
An introduction to contract testing - getting started with Pact
In this series of articles, you'll be introduced to a (fictitious but realistic) use case for consumer-driven contract testing with Pact and Pactflow....
Read more >
More public documentation/guidance on each contract test #527
We provide a contract for handlers to follow in the docs, but it will be useful for providers to know what each individual...
Read more >
Should You Use Contract Testing? - Test Engineering Notes
The main idea of contract testing is to provide fast information about broken integration without deploying services to the environment. Imagine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found