summaryrefslogtreecommitdiff
path: root/templates
AgeCommit message (Collapse)AuthorFilesLines
2021-01-10resource: Switch from 'templates' to 'share'Daniel Silverstone19-977/+0
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>
2020-12-21rust: Switch to a neater module based step function deriveDaniel Silverstone1-2/+2
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-21rust: Use commentsafe filter in rust templateDaniel Silverstone1-7/+11
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-21rust: Use nameslug in rust templateDaniel Silverstone1-1/+1
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-21feat: Initial rust templatesDaniel Silverstone2-0/+68
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-18refactor: rename tera template files to have .tera suffixLars Wirzenius4-2/+2
2020-12-02Merge branch 'remember' into 'main'Daniel Silverstone2-0/+69
Remember data for use in later steps Closes #107 See merge request larswirzenius/subplot!103
2020-12-02feat: allow saving, recalling, and expanding values in stepsLars Wirzenius2-0/+69
2020-12-02test: use shellcheck to check most shell codeLars Wirzenius7-124/+137
Split the Bash template into smaller files that don't use templating, and check those file. Fix the couple of things shellcheck complained about.
2020-11-19add scenarioLars Wirzenius3-6/+18
2020-11-18feat(templates/bash): set TMPDIR also for bash templateLars Wirzenius1-2/+3
2020-11-18refactor(templates/python): drop magic cookie for environment varsLars Wirzenius2-27/+12
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.
2020-11-17fix: set TMPDIR for each scenario to its datadirLars Wirzenius2-2/+16
2020-10-11refactor(templates/bash): unset environment variables without PythonLars Wirzenius1-2/+10
2020-10-02fix(templates/bash): when unsetting env, handle vars with newlinesLars Wirzenius1-1/+2
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.
2020-09-23fix(python/Context): fix Namespace.get to remember defaultLars Wirzenius2-3/+18
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.
2020-09-20feat: Context classes can declare namespaces for groups of valuesLars Wirzenius2-0/+83
This will enable easier separation of values stored in the context by different Subplot libraries, with less risk of accidental name clashes.
2020-09-11feat(python template): use DEBUG level and clarify Context logsLars Wirzenius1-1/+1
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.
2020-09-10feat(python template): repr(Context)Lars Wirzenius2-0/+13
2020-09-10feat(python template): delete items from ContextLars Wirzenius2-0/+9
2020-09-10feat(python template): add "foo in ctx" supportLars Wirzenius2-0/+12
2020-09-04refactor(templates/python): make helpers self-containedLars Wirzenius4-18/+37
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.
2020-09-04refactor(templates/python): split out helper code into modulesLars Wirzenius10-231/+305
Also add unit tests.
2020-09-04feat(codegen): allow templates to list helper filesLars Wirzenius1-0/+1
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
2020-06-07feat: supply source file name for functions filesLars Wirzenius2-2/+12
The Python and Bash templates now insert the name of the source files from where the function codes come from.
2020-05-24feat: set up a minimal environment in the code templatesLars Wirzenius2-0/+24
2020-05-24test(sp-meta): amend scenario to also test JSON outputLars Wirzenius1-0/+14
2020-05-20feat!: allow multiple bindings and functions filesLars Wirzenius2-2/+2
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.
2020-05-17feat(template.sh): call cleanup functions if definedLars Wirzenius1-17/+51
2020-05-17feat(template.py): call cleanup functions if definedLars Wirzenius1-2/+26
If a binding has a cleanup function defined, call it at the end of the scenario, even if a step in the scenario failed.
2020-05-17refactor(template.py): make Python template easier to followLars Wirzenius1-32/+87
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.
2020-05-10feat: make it easier to debug generated Python test programsLars Wirzenius1-4/+60
The generated test program now has --log and --save-on-failure options, and automatically logs every scenario, step, and change to context.
2020-05-08Change: bash template to run only requested scenariosLars Wirzenius1-1/+15
2020-05-08Refactor: bash template to put scenarios in functionsLars Wirzenius1-18/+30
2020-05-08Change: Python template to run only chosen scenariosLars Wirzenius1-6/+21
2020-04-25Change: use /usr/bin/env to find bashLars Wirzenius1-1/+1
2020-04-22Add: a bash template and change echo.md to use itLars Wirzenius2-0/+197
2020-04-22Change: get Python template from templates/python/template.{yaml.py}Lars Wirzenius2-0/+2
All the language specific details are now in template.yaml, including the command for how to run the generated test program.
2020-03-20Change: generated Python program runs scenarios in random orderLars Wirzenius1-18/+29
2020-02-25Fix: base64 encode everything captured from user inputLars Wirzenius1-5/+22
2020-02-15Change: require docgen, codegen to fail if document has no titleLars Wirzenius1-1/+5
sp-filter already has a test that requires it to work without a title.
2020-01-10Change: generated Python program creates temp dir for each sceanioLars Wirzenius1-0/+2
2020-01-10Add: remember original directory in Python code templateLars Wirzenius1-0/+8
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.
2020-01-08Change: use tera templates for generating Python codeLars Wirzenius1-0/+77