facebookarchive / contest

Run continuous and on-demand system testing for real and virtual hardware
MIT License
32 stars 15 forks source link

Add support for intra-step pause #278

Closed rojer9-fb closed 3 years ago

rojer9-fb commented 3 years ago

If asked to pause, a step can return ErrPaused with a piece of state that will be passed to a new instance when the job is resumed. The state is opaque but at a minimum should contain targets that were in flight at the time, they will not be reinjected and runner will expect results for them when the job is resumed.

Handling pause is not a requirement, a step can completely ignore the pause signal and pausing will still work between steps.

codecov[bot] commented 3 years ago

Codecov Report

Merging #278 (ebcd246) into master (11ef575) will increase coverage by 0.33%. The diff coverage is 79.88%.

:exclamation: Current head ebcd246 differs from pull request most recent head d6d48ae. Consider uploading reports for the commit d6d48ae to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #278      +/-   ##
==========================================
+ Coverage   67.07%   67.41%   +0.33%     
==========================================
  Files         135      136       +1     
  Lines        6435     6545     +110     
==========================================
+ Hits         4316     4412      +96     
- Misses       1626     1635       +9     
- Partials      493      498       +5     
Flag Coverage Δ
e2e 44.96% <69.32%> (+0.98%) :arrow_up:
integration 57.24% <35.05%> (-0.77%) :arrow_down:
unittests 49.03% <76.54%> (+0.24%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmds/plugins/plugins.go 9.09% <ø> (ø)
pkg/test/step.go 66.66% <ø> (ø)
plugins/teststeps/cmd/cmd.go 58.97% <0.00%> (ø)
plugins/teststeps/echo/echo.go 7.14% <0.00%> (ø)
plugins/teststeps/example/example.go 28.00% <ø> (ø)
plugins/teststeps/randecho/randecho.go 4.16% <ø> (ø)
plugins/teststeps/sshcmd/sshcmd.go 0.64% <0.00%> (ø)
tests/plugins/teststeps/channels/channels.go 0.00% <0.00%> (ø)
tests/plugins/teststeps/hanging/hanging.go 0.00% <0.00%> (ø)
tests/plugins/teststeps/noreturn/noreturn.go 28.57% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 11ef575...d6d48ae. Read the comment docs.

rojer9-fb commented 3 years ago

plugins/teststeps/sleep/sleep.go is an example of a test step plugin that supports pause and resume.

rojer9-fb commented 3 years ago

PTAL