debian-forge-composer/internal/worker
Achilleas Koutsou 778b2de3c0 worker: test mixed new and old jobs in jobqueue
Two new tests, one for OSBuild and one for Koji jobs. Both follow the
same flow:
- Enqueue a job that doesn't specify PipelineNames (oldJob)
- Enqueue a job that does specify PipelineNames (newJob)
- Read the job data for the oldJob and check that the default
  PipelineNames were added
- Read the job data for the newJob and check that it's unchanged
- Finish oldJob and add results without specifying PipelineNames
- Finish newJob and add results with PipelineNames
- Read the oldJob result and check that the default PipelineNames were
  added
- Read the newJob result and check that it's unchanged

This is meant to test several scenarios that can occur when upgrading
the service:
1. The existing jobqueue has old jobs in it that were queued before the
   PipelineNames were part of the data structure. The worker should be
   able to read these and add the fallback data.
2. New jobs are added while old jobs still exist in the queue and the
   worker can read both types.
3. The existing jobqueue has old finished jobs in it that were finished
   and had results written before the PipelineNames were part of the
   result data structure. The worker should be able to read these and
   add the fallback data.
4. New jobs are finished and results are written while old jobs still
   exist in the queue and the worker can read both result types.
2021-11-16 09:49:37 +01:00
..
api worker: Introduce manifest-id-only job 2021-11-15 16:04:12 +01:00
client.go worker: Configurable timeout for RequestJob 2021-10-19 00:12:18 +01:00
json.go worker/json: add fallback pipeline names when reading data 2021-11-16 09:49:37 +01:00
server.go worker: Introduce manifest-id-only job 2021-11-15 16:04:12 +01:00
server_test.go worker: test mixed new and old jobs in jobqueue 2021-11-16 09:49:37 +01:00