Jenkins: ensure that test_Tails_ISO jobs use the same Git state as the build_Tails_ISO jobs that triggered them

Here's an example where this was not the case: https://gitlab.tails.boum.org/tails/tails/-/merge_requests/1937#note_254360

What happened was this:

  • At 00:33:00 jenkins started a scheduled ("Started by timer") build_Tails_ISO job for the 14534-no-wifi-adapter branch, which at the time was at commit 202c0ebc
  • At 00:42:45 sajolida coincidentally pushed new commits to the 14534-no-wifi-adapter branch, now at commit 7ebea9f2
  • At 01:00:36 jenkins started a test_Tails_ISO job, which was triggered by the above build_Tails_ISO job finishing. And here is the mismatch: it ran the test suite from a Git state based on the branch's new HEAD at 7ebea9f2 when it tested an image built from a Git state based on 202c0ebc (I say "Git state based on" since we also merge the base branch)

intrigeri proposed how to fix it:

I think it should be easy to fix for test suite runs that are triggered by a build job (on https://jenkins.tails.boum.org/job/test_Tails_ISO_14534-no-wifi-adapter/21/injectedEnvVars/ you can see the info we need is available in UPSTREAMJOB_GIT_COMMIT)

I want to add that the triggered test_Tails_ISO job not only must check out the feature branch at commit UPSTREAMJOB_GIT_COMMIT, but due to the base branch merge it also must merge the base branch at commit UPSTREAMJOB_GIT_BASE_BRANCH_HEAD to replicate the Git state (modulo the merge commit hash, but that doesn't matter).