packer/packer_test
Lucas Bajolet 13c52124de packer_test: check for a panic during execution
When a command is run, it is the expectation that no test should make
Packer panic. If it did, something is wrong and Packer should be fixed
so it doesn't panic anymore in that situation.

The way we did the check before was adding a PanicCheck after the
command ran, so we could make sure of that during `Assert`.

However, since we introduced the possibility to have multiple runs,
having this addition as part of the run loop meant that the PanicCheck
would be run as many times as there were runs.

While this worked, this implied that we'd do the same check multiple
times on a single command output, which is not optimal.

Instead, this commit moves the check to within the `Run` function, this
way for each run of the command we do the check once, and then we can
assert the results of the command on what output it produced.
2024-06-17 16:51:58 -04:00
..
plugin_tester build(deps): bump golang.org/x/net in /packer_test/plugin_tester 2024-06-12 11:55:32 -04:00
templates hcl2template: detect duplicate locals during parse 2024-06-17 16:51:58 -04:00
base_test.go packer_test: compile packer with .exe for Windows 2024-06-10 09:59:32 -04:00
commands_test.go packer_test: check for a panic during execution 2024-06-17 16:51:58 -04:00
gadgets_test.go packer_test: add convenience func for line count 2024-06-10 09:59:32 -04:00
init_test.go packer_test: add SkipNoAcc function 2024-06-17 16:51:58 -04:00
install_test.go packer_test: add SkipNoAcc function 2024-06-17 16:51:58 -04:00
loading_test.go packer_test: add test with config.json/components 2024-06-10 09:59:32 -04:00
local_eval_test.go hcl2template: detect duplicate locals during parse 2024-06-17 16:51:58 -04:00
pipe_checker_test.go packer_test: don't error on empty pipeline 2024-06-10 09:59:32 -04:00
plugin_test.go packer_test: remove %d from workdir path 2024-06-10 09:59:32 -04:00
plugins_remove_test.go packer_test: Add tests for invalid plugin remove use cases 2024-06-10 09:59:32 -04:00
sample_config.json packer_test: add test with config.json/components 2024-06-10 09:59:32 -04:00
suite_test.go packer_test: add SkipNoAcc function 2024-06-17 16:51:58 -04:00