Age | Commit message (Collapse) | Author | Files | Lines |
|
In a general sense, we will want to have more than just template
files as resources. This shifts from the concept that the only
thing resource-wise that subplot has is templates, to a more general
shared resources concept without a default path beyond CWD.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
|
|
Remember data for use in later steps
Closes #107
See merge request larswirzenius/subplot!103
|
|
|
|
Split the Bash template into smaller files that don't use templating,
and check those file. Fix the couple of things shellcheck complained
about.
|
|
|
|
|
|
We previously changed the Python template to set TMPDIR to the
per-scenario directory. Part of that was using a "magic cookie" value
to indicate which environment variables to set to the scenario
directory. The cookie is unnecessary: we can just set the environment
variables at the start of the scenario. This commit does that.
|
|
|
|
|
|
Previously we couldn't handle environments with the TERMCAP variable.
Now we can.
TERMCAP is set, for example, when logging in via ssh to a beefy server
to run tests or benchmarks.
|
|
Problem: given a Namespace ns, if I want to have a dict field and I do
`d = ns.get("foo", {})` I get a dict, but it doesn't get stored in the
Namespace. So next time I use the same construct to get the dict, I
get a brand new dict.
Fix: Store the default value in the Namespace so the same object gets
returned the next time.
Also add a little debug logging and improvements to repr(Context) that
helped me debug this.
|
|
This will enable easier separation of values stored in the context by
different Subplot libraries, with less risk of accidental name clashes.
|
|
Log changes to Contexts at DEBUG level, and make the log message a
little clearer. Previously, the foo=bar message was confusing enough
to me, who wrote, that I misinterpreted in the midst of an intense
debugging session.
|
|
|
|
|
|
|
|
To make every helper module be self-contained, move things around so
that a helper doesn't refer to global symbols from another helper.
This will allow us to use things like flake8 to statically check the
helper modules for common errors.
|
|
Also add unit tests.
|
|
A template's YAML file can now list any additional files, called
helpers. An empty list is OK, as is not having the 'helper' key in the
YAML file. The helpers are loaded as Tera templates so they can be
included in the main template.
This will allow us to split out un-templated code out of the main
template. The helpers can then be linted and unit tested separately.
This commit only adds the mechanism, and fixes up the YAML files.
Later commits will actually split the main Python template into
helpers, and add unit tests.
refactor: use .join
|
|
The Python and Bash templates now insert the name of the source files
from where the function codes come from.
|
|
|
|
|
|
Where previously the document metadata could specify a single bindings
file, and a single functions file, it can now specify one or more. If
a single value is given, that's the filename. Otherwise, it can be a
YAML list of filenames.
Drop the functions_filename template variable, which was effectively
unused, and for which there is no recorded use case at this time.
|
|
|
|
If a binding has a cleanup function defined, call it at the end of the
scenario, even if a step in the scenario failed.
|
|
It had become hard for me to follow the actual logic of the Python
code running scenarios. This commit changes things so that the logic
is clean Python, without any templates, using classes for steps and
scenarios. The code that instantiates those classes still needs
templates, but is correspondingly simpler and easier to follow.
|
|
The generated test program now has --log and --save-on-failure
options, and automatically logs every scenario, step, and change to
context.
|
|
|
|
|
|
|
|
|
|
|
|
All the language specific details are now in template.yaml, including
the command for how to run the generated test program.
|
|
|
|
|
|
sp-filter already has a test that requires it to work without a title.
|
|
|
|
We create and chdir to a temporary directory, but the step
function may need to refer to the original directory the test program
is launched from.
|
|
|