Skip to content

Commit

Permalink
fix: maintain order in test vectors for languages with parallel tests (
Browse files Browse the repository at this point in the history
…#641)

* fix: maintain order in test vectors for languages with parallel tests
  • Loading branch information
ajewellamz authored and lucasmcdonald3 committed Aug 29, 2024
1 parent f1ac82f commit 2ea6658
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ module {:extern} TestWrappedMaterialProvidersMain {
// Runtime should define an extern to return the expected test execution directory.
method {:extern} GetTestVectorExecutionDirectory() returns (res: string)

// This MUST go before TestEncryptManifest
method {:test} TestGenerateEncryptManifest() {
// This is done to maintain order in systems that run tests in parallel
// such as Rust.
method {:test} RunManifestTests() {
TestGenerateEncryptManifest();
TestEncryptManifest();
TestDecryptManifest();
}

method TestGenerateEncryptManifest() {
var directory := GetTestVectorExecutionDirectory();
var result := CompleteVectors.WriteStuff(
EncryptManifest(
Expand All @@ -30,8 +37,7 @@ module {:extern} TestWrappedMaterialProvidersMain {
expect result.Success?;
}

// This MUST go before TestDecryptManifest
method {:test} TestEncryptManifest() {
method TestEncryptManifest() {
var directory := GetTestVectorExecutionDirectory();
var result := TestManifests.StartEncrypt(
Encrypt(
Expand All @@ -45,7 +51,7 @@ module {:extern} TestWrappedMaterialProvidersMain {
expect result.Success?;
}

method {:test} TestDecryptManifest() {
method TestDecryptManifest() {
var directory := GetTestVectorExecutionDirectory();
var result := TestManifests.StartDecrypt(
Decrypt(
Expand Down

0 comments on commit 2ea6658

Please sign in to comment.