This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
cmd/unity: support for version-based conditions #57
Labels
enhancement
New feature or request
Milestone
#55 demonstrates a case where a fix in CUE revealed a bug in the expectations for the Vector project. Up until that PR therefore,
tip
of CUE would fail against unity.It's clearly not sustainable to have a broken
unity
build where we need to remember "oh that's fine because project XYZ's expectation is wrong, we fixed something in CUE".Neither is it workable to expect project XYZ to move immediately to the version of CUE that correspond to the fix.
Nor is it wise to simply skip such projects from the corpus tests of later CUE versions until project XYZ updates to a later CUE version: we simply lose coverage this way.
Therefore, we need to support bridging multiple versions, and support expectations corresponding to the fixes that have been introduced since the base version of CUE used by a project.
We probably end up with a workflow something like this:
untiy
build run as part of CL trybot failsunity
The challenge here comes in supporting multiple expectations. Because the base version of CUE against which project XYZ is tested still needs to work. Hence our expectations in
testscript
-style tests need to be made conditional.Question: how do these conditions work in the context of Go tests and #41? We have far less control over tests in that situation, indeed there is really no concept of an overlay at all. Answer is likely they don't work and we do have to skip Go tests in such situations, with some sort of detail in the
tests
manifest on the CUE version (ranges) for which Go tests are not run.For the
testscript
-style tests we can use versioned-based conditions to gate whether commands are run or not. For example:Based on the version of CUE under test
X
, such a version-based condition would be satisfied (i.e. the command run) if the commit corresponding toX
is a descendant of the condition version, in this casev0.3.0-beta.6
.The versions supported in these conditions would be a subset of the versions understood by
unity
:commit:$sha
$semver
changeID:$changeID
(not yet supported byunity
- see cmd/unity: support additional version resolution methods #56)Implementation notes:
git merge-base --is-ancestor <maybe-ancestor-commit> <descendant-commit>
commandcue
repolockedfile
lock (same lock file as used elsewhere inunity
) should be held whilst checking and conditionstestscript
code that does thisPATH
) then we should error in case evaluation against a version condition is encounteredThe text was updated successfully, but these errors were encountered: