fediverse-devnet / feditest

A testing framework for distributed, heterogeneous systems communicating with complex protocols, such as the Fediverse
https://feditest.org/
MIT License
33 stars 6 forks source link

TemplateNotFound #212

Closed jernst closed 3 months ago

jernst commented 3 months ago

Just now. Executed from a directory that's somewhere else than the usual directories.

feditest convert-transcript \
        --in production/testresults/webfinger-server-all-wellknown-saas-imp.json \
        --tap production/testresults/webfinger-server-all-wellknown-saas-imp.tap
feditest convert-transcript \
        --in production/testresults/webfinger-server-all-wellknown-saas-imp.json \
        --html production/testresults/webfinger-server-all-wellknown-saas-imp.sequential.html \
        --template testrun-report-sequential-standalone
2024-07-09T16:53:48Z [CRITICAL] feditest: <class 'jinja2.exceptions.TemplateNotFound'> -- TemplateNotFound test_matrix.jinja2
jernst commented 3 months ago

More detail:

feditest -v -v convert-transcript --in production/testresults/webfinger-server-all-wellknown-saas-imp.json --html production/testresults/webfinger-server-all-wellknown-saas-imp.sequential.html --template testrun-report-sequential-standalone

produces

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/cli/__init__.py", line 38, in main
    ret = cmds[cmd_name].run(parser, args, remaining)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/cli/commands/convert_transcript.py", line 36, in run
    multifile_serializer.write(transcript)
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/testruntranscript.py", line 544, in write
    matrix_template = jinja2_env.get_template("test_matrix.jinja2")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
    source, filename, uptodate = self.get_source(environment, name)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/loaders.py", line 204, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: test_matrix.jinja2
2024-07-10T11:22:26Z [CRITICAL] feditest: <class 'jinja2.exceptions.TemplateNotFound'> -- TemplateNotFound test_matrix.jinja2Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/cli/__init__.py", line 38, in main
    ret = cmds[cmd_name].run(parser, args, remaining)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/cli/commands/convert_transcript.py", line 36, in run
    multifile_serializer.write(transcript)
  File "/opt/homebrew/lib/python3.11/site-packages/feditest/testruntranscript.py", line 544, in write
    matrix_template = jinja2_env.get_template("test_matrix.jinja2")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/environment.py", line 1010, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/environment.py", line 969, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/loaders.py", line 125, in load
    source, filename, uptodate = self.get_source(environment, name)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/jinja2/loaders.py", line 204, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: test_matrix.jinja2
jernst commented 3 months ago

Ahh ... operator error. NVM, I didn't update my Makefile to reflect the newest feditest version. A template with that name does not exist any more. However, we need better error reporting, see #217.