-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add more transport version validation cases #134597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
006cbb8
2ff0e9a
68666ba
874b6c8
fd275a7
cf5228f
9b8cbec
6d46c0a
c4a3677
3750a5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,17 @@ class TransportVersionValidationFuncTest extends AbstractTransportVersionFuncTes | |
def result = validateResourcesFails() | ||
then: | ||
assertValidateResourcesFailure(result, "Transport version definition file " + | ||
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv] modifies existing patch id from 8012001 to 8012002") | ||
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv] has modified patch id from 8012001 to 8012002") | ||
} | ||
|
||
def "cannot change committed ids"() { | ||
given: | ||
referableTransportVersion("existing_92", "8123000") | ||
when: | ||
def result = validateResourcesFails() | ||
then: | ||
assertValidateResourcesFailure(result, "Transport version definition file " + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I get the same error if entire file is removed? Say, I commit a TV change and then revert the entire thing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. In that case you would get an error about a referenced transport version that doesn't have a definition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean if you reverted the entire change. So you removed any references as well. Would we catch such a revert? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not, at least not directly, but sort of by design. We have to be able to remove transport versions eventually. The trick is we have to remove them from the tail end. However, if someone were to just remove a transport version in the middle of the known transport versions, we should eventually catch this with our primary id density check. But we can't do that until we've migrated more transport versions to remove the gap we currently have. |
||
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv] has removed id 8012001") | ||
} | ||
|
||
def "upper bounds files must reference defined name"() { | ||
|
@@ -201,8 +211,8 @@ class TransportVersionValidationFuncTest extends AbstractTransportVersionFuncTes | |
|
||
def "upper bound can refer to an unreferable definition"() { | ||
given: | ||
unreferableTransportVersion("initial_10.0.0", "10000000") | ||
transportVersionUpperBound("10.0", "initial_10.0.0", "10000000") | ||
unreferableTransportVersion("initial_9.3.0", "8124000") | ||
transportVersionUpperBound("9.3", "initial_9.3.0", "8124000") | ||
when: | ||
def result = gradleRunner(":myserver:validateTransportVersionResources").build() | ||
then: | ||
|
@@ -232,24 +242,39 @@ class TransportVersionValidationFuncTest extends AbstractTransportVersionFuncTes | |
|
||
def "highest id in an referable definition should exist in an upper bounds file"() { | ||
given: | ||
referableAndReferencedTransportVersion("some_tv", "10000000") | ||
referableAndReferencedTransportVersion("some_tv", "8124000") | ||
when: | ||
def result = validateResourcesFails() | ||
then: | ||
assertValidateResourcesFailure(result, "Transport version definition file " + | ||
"[myserver/src/main/resources/transport/definitions/referable/some_tv.csv] " + | ||
"has the highest transport version id [10000000] but is not present in any upper bounds files") | ||
"has the highest transport version id [8124000] but is not present in any upper bounds files") | ||
} | ||
|
||
def "highest id in an unreferable definition should exist in an upper bounds file"() { | ||
given: | ||
unreferableTransportVersion("initial_10.0.0", "10000000") | ||
unreferableTransportVersion("initial_9.3.0", "8124000") | ||
when: | ||
def result = validateResourcesFails() | ||
then: | ||
// TODO: this should be _unreferable_ in the error message, but will require some rework | ||
assertValidateResourcesFailure(result, "Transport version definition file " + | ||
"[myserver/src/main/resources/transport/definitions/referable/initial_10.0.0.csv] " + | ||
"has the highest transport version id [10000000] but is not present in any upper bounds files") | ||
"[myserver/src/main/resources/transport/definitions/unreferable/initial_9.3.0.csv] " + | ||
"has the highest transport version id [8124000] but is not present in any upper bounds files") | ||
} | ||
|
||
def "primary ids cannot jump ahead too fast"() { | ||
given: | ||
referableAndReferencedTransportVersion("some_tv", "8125000") | ||
transportVersionUpperBound("9.2", "some_tv", "8125000") | ||
|
||
when: | ||
def result = validateResourcesFails() | ||
|
||
then: | ||
assertValidateResourcesFailure(result, "Transport version definition file " + | ||
"[myserver/src/main/resources/transport/definitions/referable/some_tv.csv] " + | ||
"has primary id 8125000 which is more than maximum increment 1000 from id 8123000 in definition " + | ||
"[myserver/src/main/resources/transport/definitions/referable/existing_92.csv]" | ||
) | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.