@@ -43,25 +43,25 @@ pub(crate) fn run_unified_tests(spec: &'static [&'static str]) -> RunUnifiedTest
4343type FileTransformation = Box < dyn Fn ( & mut TestFile ) + Send + Sync > ;
4444pub ( crate ) struct RunUnifiedTestsAction {
4545 spec : & ' static [ & ' static str ] ,
46- skipped_files : Option < & ' static [ & ' static str ] > ,
47- skipped_tests : Option < & ' static [ & ' static str ] > ,
46+ skipped_files : Option < Vec < & ' static str > > ,
47+ skipped_tests : Option < Vec < & ' static str > > ,
4848 file_transformation : Option < FileTransformation > ,
4949}
5050
5151impl RunUnifiedTestsAction {
5252 /// The files to skip deserializing. The provided filenames should only contain the filename and
5353 /// extension, e.g. "unacknowledged-writes.json". Filenames are matched case-sensitively.
54- pub ( crate ) fn skip_files ( self , skipped_files : & ' static [ & ' static str ] ) -> Self {
54+ pub ( crate ) fn skip_files ( self , skipped_files : & [ & ' static str ] ) -> Self {
5555 Self {
56- skipped_files : Some ( skipped_files) ,
56+ skipped_files : Some ( skipped_files. to_vec ( ) ) ,
5757 ..self
5858 }
5959 }
6060
6161 /// The descriptions of the tests to skip. Test descriptions are matched case-sensitively.
62- pub ( crate ) fn skip_tests ( self , skipped_tests : & ' static [ & ' static str ] ) -> Self {
62+ pub ( crate ) fn skip_tests ( self , skipped_tests : & [ & ' static str ] ) -> Self {
6363 Self {
64- skipped_tests : Some ( skipped_tests) ,
64+ skipped_tests : Some ( skipped_tests. to_vec ( ) ) ,
6565 ..self
6666 }
6767 }
@@ -85,15 +85,15 @@ impl IntoFuture for RunUnifiedTestsAction {
8585 fn into_future ( self ) -> Self :: IntoFuture {
8686 async move {
8787 for ( mut test_file, path) in
88- deserialize_spec_tests :: < TestFile > ( self . spec , self . skipped_files )
88+ deserialize_spec_tests :: < TestFile > ( self . spec , self . skipped_files . as_deref ( ) )
8989 {
9090 if let Some ( ref file_transformation) = self . file_transformation {
9191 file_transformation ( & mut test_file) ;
9292 }
9393
9494 let test_runner = TestRunner :: new ( ) . await ;
9595 test_runner
96- . run_test ( test_file, path, self . skipped_tests )
96+ . run_test ( test_file, path, self . skipped_tests . as_ref ( ) )
9797 . await ;
9898 }
9999 }
@@ -105,34 +105,31 @@ impl IntoFuture for RunUnifiedTestsAction {
105105#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
106106async fn valid_pass ( ) {
107107 let _guard: RwLockWriteGuard < _ > = LOCK . run_exclusively ( ) . await ;
108- # [ cfg ( feature = "in-use-encryption-unstable" ) ]
109- let skipped_files = & [
110- // TODO RUST-1570: unskip this file (ditto below)
108+
109+ let mut skipped_files = vec ! [
110+ // TODO RUST-1570: unskip this file
111111 "collectionData-createOptions.json" ,
112- // TODO RUST-1405: unskip this file (ditto below)
112+ // TODO RUST-1405: unskip this file
113113 "expectedError-errorResponse.json" ,
114- // TODO RUST-582: unskip these files (ditto below)
114+ // TODO RUST-582: unskip these files
115115 "entity-cursor-iterateOnce.json" ,
116116 "matches-lte-operator.json" ,
117117 // TODO: unskip this file when the convenient transactions API tests are converted to the
118- // unified format (ditto below)
118+ // unified format
119119 "poc-transactions-convenient-api.json" ,
120120 ] ;
121- #[ cfg( not( feature = "in-use-encryption-unstable" ) ) ]
122- let skipped_files = & [
123- "collectionData-createOptions.json" ,
124- "expectedError-errorResponse.json" ,
125- "entity-cursor-iterateOnce.json" ,
126- "matches-lte-operator.json" ,
127- "poc-transactions-convenient-api.json" ,
128- // These tests need the in-use-encryption-unstable feature flag to be deserialized and run.
129- "kmsProviders-placeholder_kms_credentials.json" ,
130- "kmsProviders-unconfigured_kms.json" ,
131- "kmsProviders-explicit_kms_credentials.json" ,
132- "kmsProviders-mixed_kms_credential_fields.json" ,
133- ] ;
121+ // These tests need the in-use-encryption-unstable feature flag to be deserialized and run.
122+ if cfg ! ( not( feature = "in-use-encryption-unstable" ) ) {
123+ skipped_files. extend ( & [
124+ "kmsProviders-placeholder_kms_credentials.json" ,
125+ "kmsProviders-unconfigured_kms.json" ,
126+ "kmsProviders-explicit_kms_credentials.json" ,
127+ "kmsProviders-mixed_kms_credential_fields.json" ,
128+ ] ) ;
129+ }
130+
134131 run_unified_tests ( & [ "unified-test-format" , "valid-pass" ] )
135- . skip_files ( skipped_files)
132+ . skip_files ( & skipped_files)
136133 // This test relies on old OP_QUERY behavior that many drivers still use for < 4.4, but
137134 // we do not use, due to never implementing OP_QUERY.
138135 . skip_tests ( & [ "A successful find event with a getmore and the server kills the cursor (<= 4.4)" ] )
0 commit comments