aws-samples / aws-proton-workshop-code

AWS Proton workshop - Sample Cloudformation and Terraform Templates
MIT No Attribution
11 stars 164 forks source link

Test Jinja Error #8

Open allamand opened 1 year ago

allamand commented 1 year ago

Hello,

In the https://catalog.workshops.aws/proton/en-US/module-1/services/define-the-service-instance-infrastructure part of test jinja, you don't show the expected results when running the script, and it fails on my side:

python3 -m unittest discover -s .

E
======================================================================
ERROR: test_jinja (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_jinja
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/home/linuxbrew/.linuxbrew/opt/python@3.10/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/ubuntu/environment/proton/aws-proton-workshop/test_jinja.py", line 13, in <module>
    class TestJinja(unittest.TestCase):
  File "/home/ubuntu/environment/proton/aws-proton-workshop/test_jinja.py", line 21, in TestJinja
    conf = YamlLintConfig('{\
  File "/home/ubuntu/environment/proton/aws-proton-workshop/venv/lib/python3.10/site-packages/yamllint/config.py", line 45, in __init__
    self.validate()
  File "/home/ubuntu/environment/proton/aws-proton-workshop/venv/lib/python3.10/site-packages/yamllint/config.py", line 148, in validate
    self.rules[id] = validate_rule_conf(rule, self.rules[id])
  File "/home/ubuntu/environment/proton/aws-proton-workshop/venv/lib/python3.10/site-packages/yamllint/config.py", line 189, in validate_rule_conf
    raise YamlLintConfigError(
yamllint.config.YamlLintConfigError: invalid config: option "spaces" of "indentation" should be in (<class 'int'>, 'consistent')

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
moralesl commented 1 year ago

Hey @allamand, I've updated the workshop resources and the CF template, so now it should work. If you find the time, could verify this as well?

Thanks in advance!