runner: asking a test run again moves every reader that did not pass (R5)
A rerun of one artifact's failed test step left the other artifact's step failed on a result no longer true; the rerun now joins, reads or starts the key's run, carrying the former readers marked in the key, and the new run's end moves the marked ones, said again as a rerun by its caller and naming the new ask, the pipeline reopened; an accepted step does not move. Builds: design 47 G §727 (test part); A-469l, A-470d, A-470e
This commit is contained in:
@@ -34,7 +34,7 @@ type testRunsKV struct {
|
||||
kv jetstream.KeyValue
|
||||
}
|
||||
|
||||
func (t testRunsKV) Create(key string, r seat.TestRun) error {
|
||||
func (t testRunsKV) Create(key string, r pipeline.Run) error {
|
||||
raw, err := json.Marshal(r)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -47,22 +47,22 @@ func (t testRunsKV) Create(key string, r seat.TestRun) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t testRunsKV) Get(key string) (seat.TestRun, uint64, error) {
|
||||
func (t testRunsKV) Get(key string) (pipeline.Run, uint64, error) {
|
||||
e, err := t.kv.Get(t.ctx, key)
|
||||
if errors.Is(err, jetstream.ErrKeyNotFound) {
|
||||
return seat.TestRun{}, 0, pipeline.ErrNoRun
|
||||
return pipeline.Run{}, 0, pipeline.ErrNoRun
|
||||
}
|
||||
if err != nil {
|
||||
return seat.TestRun{}, 0, err
|
||||
return pipeline.Run{}, 0, err
|
||||
}
|
||||
var r seat.TestRun
|
||||
var r pipeline.Run
|
||||
if err := json.Unmarshal(e.Value(), &r); err != nil {
|
||||
return seat.TestRun{}, 0, fmt.Errorf("the test run %s is no test run: %w", key, err)
|
||||
return pipeline.Run{}, 0, fmt.Errorf("the test run %s is no test run: %w", key, err)
|
||||
}
|
||||
return r, e.Revision(), nil
|
||||
}
|
||||
|
||||
func (t testRunsKV) Update(key string, r seat.TestRun, revision uint64) (uint64, error) {
|
||||
func (t testRunsKV) Update(key string, r pipeline.Run, revision uint64) (uint64, error) {
|
||||
raw, err := json.Marshal(r)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
||||
Reference in New Issue
Block a user