summaryrefslogtreecommitdiff
path: root/tests/unit/test_serial.py
Commit message (Collapse)AuthorAgeFilesLines
* Make fake test Gerrit merger more realisticJames E. Blair2020-04-291-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current Gerrit simulated merge operation simply resets the target branch to the specified change's commit -- it doesn't actually perform a git merge operation as gerrit (typically) would. This makes some test situations difficult, such as when we want to rely on a post-merge pipeline preparing git repos on top of previously merged changes. This change actually performs git merge operations when gerrit changes are merged in tests, so the result should be far more realistic. One test relied on a side effect of the old behavior: test_zuul_trigger_project_change_merged This test merges change A and then performed a merge check on change B, which conflicts, and then reports Verified -1. It then repeats the test by merging change D which conflicts with change E which should also receive Verified -1. However, the test inadvertently ran a second merge check on change B when change D merged, but because it tested D as written instead of merged on top of A after A was merged, the conflict of B against A was not seen (because B does not conflict with D) and therefore not rported. With this patch, the conflict of B against the merged change A is seen and the test failed because it reported B's merge conflict twice. To correct this, we make the test even more realistic by adding a pipeline requirement that we have not already reported Verified -1 in order to enqueue a change for merge-check. In order for this to work, we need to make sure Zuul sees the comment-added events for the Verified -1 votes (so that the Gerrit driver updates its view of the votes on the change), so those are added to the test. Change-Id: Ia5b4b83096de3b8719c8b6d256e8e33749e7a5b8
* Add serial pipeline managerJames E. Blair2020-04-291-0/+130
This is designed to handle the case where we want: * The pipeline to be triggered by changes so results report back to the change. * Triggered on change merged. * Jobs with file matchers so that if a subsystem is changed, only the deployment job for that subsystem is run. * Every change is processed in strict sequence. This is designed to accomodate a deployment pipeline with the above constraints. The pipeline manager hierarchy is getting complicated; mark the base class as abstract, and also move the shared-queue methods into an intermediate abstract class. These are shared by both serial and dependent managers. Change-Id: I3c5f3b2f6298292c5c25665923e3a10b07be5419