From e329d66940f536edab091643495302e57d6eed11 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Mon, 26 Aug 2024 12:10:16 -0400 Subject: [PATCH 1/3] fix: maintain order in test vectors for languages with parallel tests --- .../test/RunMain.dfy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy index 7620fa302..f17e299df 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy +++ b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy @@ -17,8 +17,13 @@ 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() { + method RunManifestTests() { + TestGenerateEncryptManifest(); + TestEncryptManifest(); + TestDecryptManifest(); + } + + method TestGenerateEncryptManifest() { var directory := GetTestVectorExecutionDirectory(); var result := CompleteVectors.WriteStuff( EncryptManifest( @@ -30,8 +35,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( @@ -45,7 +49,7 @@ module {:extern} TestWrappedMaterialProvidersMain { expect result.Success?; } - method {:test} TestDecryptManifest() { + method TestDecryptManifest() { var directory := GetTestVectorExecutionDirectory(); var result := TestManifests.StartDecrypt( Decrypt( From 8057e9ac865b2c2d3cf90ee9ca07b162c6ba9e62 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Mon, 26 Aug 2024 12:31:45 -0400 Subject: [PATCH 2/3] m --- .../test/RunMain.dfy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy index f17e299df..d9e76b952 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy +++ b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy @@ -17,7 +17,7 @@ module {:extern} TestWrappedMaterialProvidersMain { // Runtime should define an extern to return the expected test execution directory. method {:extern} GetTestVectorExecutionDirectory() returns (res: string) - method RunManifestTests() { + method {:test} RunManifestTests() { TestGenerateEncryptManifest(); TestEncryptManifest(); TestDecryptManifest(); From ec8eaee923c869b1e28ad4e69dfb8f854411f5d0 Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:34:04 -0400 Subject: [PATCH 3/3] Update TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy Co-authored-by: seebees --- .../test/RunMain.dfy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy index d9e76b952..b93d9499c 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy +++ b/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/RunMain.dfy @@ -17,6 +17,8 @@ module {:extern} TestWrappedMaterialProvidersMain { // Runtime should define an extern to return the expected test execution directory. method {:extern} GetTestVectorExecutionDirectory() returns (res: string) + // This is done to maintain order in systems that run tests in parallel + // such as Rust. method {:test} RunManifestTests() { TestGenerateEncryptManifest(); TestEncryptManifest();