summaryrefslogtreecommitdiff
path: root/share
AgeCommit message (Collapse)AuthorFilesLines
2021-11-15refactor: format daemon.py using blackLars Wirzenius1-0/+1
Sponsored-by: author
2021-10-28refactor: use simple patterns where possibleLars Wirzenius1-32/+16
Many of our bindings files were originally written before Subplot supported simple patterns, and so they use regex patterns even when a simple pattern would do. Simplify bindings to use simple patterns when possible, to make life easier for future maintainers. Sponsored-by: author
2021-10-13daemon: Support finding the binary on the PATHDaniel Silverstone1-1/+14
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-10-13templates: Inherit environment for the most partDaniel Silverstone2-17/+3
We inherit all the environment except we override a few variables in order to provide some level of consistency. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-25feat: add --run-all (-k) option to Python test runnerLars Wirzenius1-10/+24
This allows the user to run all scenarios even if one fails. Sponsored-by: author
2021-09-16fix: make sure the then branch can never be emptyLars Wirzenius1-0/+1
Sponsored-by: pep.foundation
2021-09-14style: remove unwanted spaces in function definitionLars Wirzenius1-1/+1
Sponsored-by: author
2021-09-07tests: Move Python tests out of share/Daniel Silverstone5-532/+0
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07library: Make files.yaml properly polyglotDaniel Silverstone6-163/+62
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07share: Make runcmd.yaml properly polyglot and commonDaniel Silverstone4-139/+48
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-09-07bindings: Parse polyglot bindingsDaniel Silverstone7-123/+354
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-08-07chore: tell shellcheck it's OKLars Wirzenius1-0/+1
Newer version of shellcheck complains about expanding an unused variable, but since the code is actually only a snippet that will be embedded in the generated output, this is OK. Sponsored-by: author
2021-08-07Merge branch 'main' into 'main'Lars Wirzenius1-4/+16
bash template: Provice captures to cleanups See merge request subplot/subplot!198
2021-08-06bash: Fix asserts preventing cleanupRichard Maw1-2/+2
2021-08-06bash template: Provide captures to cleanupsRichard Maw1-4/+16
2021-08-06fix: Remove double newline from bash envnamesRichard Maw1-1/+1
This doesn't materially change behaviour because words split the same but it's unintentional and against the described behaviour.
2021-08-05bash: Support --env option in generated scriptsRichard Maw1-0/+39
2021-08-05fix: Make bash envnames pure shell againRichard Maw1-1/+1
This should hopefully avoid the previous version's pitfalls by processing the environment line entirely in sed.
2021-08-05fix: bash files implementations inability to readRichard Maw1-3/+4
The template unpacks the embedded files into the datadir before the scendir is created and chdir'd into. Since dict_* assume that the files you want to read are in the current directory this makes them unreadable. Making them operate relative to datadir seemed like the least complicated solution, compared to copying them in or some kind of search path.
2021-07-30Fix flake8 warningsAlexander Batischev1-0/+3
2021-07-29feat(lib/daemon.py): add way to specify env varsAlexander Batischev3-6/+126
2021-07-28fix: use socket/bind/listen for compa with Python < 3.8Lars Wirzenius1-1/+4
Sponsored-by: author
2021-07-28test: log stderr when asserting that daemon didn't fail to startLars Wirzenius1-0/+5
Sponsored-by: author
2021-07-28test: log _daemon namespace for debugging CILars Wirzenius1-0/+1
2021-07-27Fix daemon.py tests' dependence on netcatAlexander Batischev3-18/+31
This commit fixes two intertwined problems: 1) with traditional netcat, `netcat -l 8888` treats "8888" as a host, and never starts listening on port 8888. This is fixed by replacing netcat with a Python script (as suggested by Lars Wirzenius); 2) Subplot's test suite never notices the above problem because, even though it fails to connect to the port, this error is intentionally swallowed by `_daemon_start_soonish()`. This is fixed by adding an explicit check to ensure that the daemon started after all. Furthermore, the scenario description is reworded to make it clear that we *do* expect the daemon to start, it'll just take a while.
2021-07-08chore: make f-strings without placeholders into normal stringsLars Wirzenius2-10/+10
This has no functional effect, but makes linters happy. It is also arguably the right thing to do. Sponsored-by: author
2021-06-11python: Do not sort lists when asserting dictionary equalityDaniel Silverstone1-4/+26
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-06-09feat(lib/daemon.py): split stdout/stderr when logging into linesLars Wirzenius1-8/+11
Sponsored-by: author
2021-05-30test: use assert_dict_eq for better error outputLars Wirzenius1-2/+2
2021-05-30fix: unset environment variablesLars Wirzenius1-1/+1
The previous code had trouble with environment variables that weren't nice for shell. Using Python avoids this. Not an ideal solution, but I can't be bothered do avoid Python now.
2021-05-19subplotlib: Add running in a subdir to runcmdDaniel Silverstone1-0/+8
This adds the bindings and step implementations for running commands in a directory off the datadir. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-05-01test: make Python backend logging nicerLars Wirzenius5-30/+114
Mostly this avoids writing very long lines. Long strings are broken into multiple lines, logged separately. Various other values are also logged as multiple log lines as well.
2021-04-25fix: improve logging in runcmd_runLars Wirzenius1-4/+8
kwargs are logged as a dict. This helps me debug why reference.md fails.
2021-04-24fix: format stringLars Wirzenius1-1/+1
2021-04-23chore: clean up log files from generated Python programsLars Wirzenius4-15/+39
This is a step in the right direction, but may not be enough. We'll see. Multi-line log messages are no multiple lines in in the log file. All but the first one are indented. Dictionaries are listed with one key per line. argv as one item per line. Various log messages that are just noise removed.
2021-04-12Merge branch 'runcmd_cwd' into 'main'Daniel Silverstone3-1/+38
feat(python lib/runcmd): run commands in sub-directory Closes #175 See merge request larswirzenius/subplot!146
2021-04-12fix: log content, as claimed, not regexLars Wirzenius1-1/+1
2021-04-12feat(python lib/runcmd): run commands in sub-directoryLars Wirzenius3-1/+38
2021-02-25feat: directory handling steps for Python lib/filesLars Wirzenius3-0/+80
2021-02-07rust/files: Add bindings for directoriesDaniel Silverstone1-0/+21
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-02-07test(lib/runcmd): verify that runcmd_prepend_to_path worksLars Wirzenius3-0/+44
2021-02-07refactor(lib/daemon.py): reformat with BlackLars Wirzenius1-3/+9
I don't know how this passed ./check previously. I might not have had Black installed, maybe. Anyway, fixed now.
2021-01-23share/rust: Add macro for step builder and use it for cleanup tooDaniel Silverstone3-29/+36
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-22feat! Python step cleanup functions now get step capturesLars Wirzenius2-3/+3
Previously, step cleanup functions didn't get any step captures at all. This made it harder to do things like a step that starts a daemon: - when: I start {name} in the background function: start_daemon cleanup: stop_daemon The function to start the daemon gets the daemon name as an argument. The cleanup function doesn't. How is the cleanup function to know which daemon to stop? The workaround has been that the start function stores the name somewhere, but that gets tricky when a scenario may start several daemons. With this commit, the cleanup function gets the name as an argument, just like the start function, and knows what to clean up.
2021-01-20feat: lib/daemon.py can return daemon stdout/stderr content so farLars Wirzenius3-2/+114
2021-01-16Merge branch 'vfs' into 'main'Lars Wirzenius31-0/+2251
Resources - virtual filesystem See merge request larswirzenius/subplot!122
2021-01-10subplotlib: Move steplibrary into share treeDaniel Silverstone3-0/+170
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-10resources: Move lib/* to share/python/lib/Daniel Silverstone9-0/+995
This is part of the move to embed subplot library files into the binary to permit easy `cargo install` later. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-10resources: Rearrange share/ structure ready for lib importDaniel Silverstone19-0/+0
In readiness for the lib/ import, rearrange from a structure of share/templates/$lang/... to be share/$lang/template/... This will permit share/$lang/lib/ to exist later. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2021-01-10resource: Switch from 'templates' to 'share'Daniel Silverstone19-0/+977
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>