@@ -43,25 +43,25 @@ pub(crate) fn run_unified_tests(spec: &'static [&'static str]) -> RunUnifiedTest
43
43
type FileTransformation = Box < dyn Fn ( & mut TestFile ) + Send + Sync > ;
44
44
pub ( crate ) struct RunUnifiedTestsAction {
45
45
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 > > ,
48
48
file_transformation : Option < FileTransformation > ,
49
49
}
50
50
51
51
impl RunUnifiedTestsAction {
52
52
/// The files to skip deserializing. The provided filenames should only contain the filename and
53
53
/// 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 {
55
55
Self {
56
- skipped_files : Some ( skipped_files) ,
56
+ skipped_files : Some ( skipped_files. to_vec ( ) ) ,
57
57
..self
58
58
}
59
59
}
60
60
61
61
/// 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 {
63
63
Self {
64
- skipped_tests : Some ( skipped_tests) ,
64
+ skipped_tests : Some ( skipped_tests. to_vec ( ) ) ,
65
65
..self
66
66
}
67
67
}
@@ -85,15 +85,15 @@ impl IntoFuture for RunUnifiedTestsAction {
85
85
fn into_future ( self ) -> Self :: IntoFuture {
86
86
async move {
87
87
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 ( ) )
89
89
{
90
90
if let Some ( ref file_transformation) = self . file_transformation {
91
91
file_transformation ( & mut test_file) ;
92
92
}
93
93
94
94
let test_runner = TestRunner :: new ( ) . await ;
95
95
test_runner
96
- . run_test ( test_file, path, self . skipped_tests )
96
+ . run_test ( test_file, path, self . skipped_tests . as_ref ( ) )
97
97
. await ;
98
98
}
99
99
}
@@ -105,34 +105,31 @@ impl IntoFuture for RunUnifiedTestsAction {
105
105
#[ cfg_attr( feature = "async-std-runtime" , async_std:: test) ]
106
106
async fn valid_pass ( ) {
107
107
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
111
111
"collectionData-createOptions.json" ,
112
- // TODO RUST-1405: unskip this file (ditto below)
112
+ // TODO RUST-1405: unskip this file
113
113
"expectedError-errorResponse.json" ,
114
- // TODO RUST-582: unskip these files (ditto below)
114
+ // TODO RUST-582: unskip these files
115
115
"entity-cursor-iterateOnce.json" ,
116
116
"matches-lte-operator.json" ,
117
117
// TODO: unskip this file when the convenient transactions API tests are converted to the
118
- // unified format (ditto below)
118
+ // unified format
119
119
"poc-transactions-convenient-api.json" ,
120
120
] ;
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
+
134
131
run_unified_tests ( & [ "unified-test-format" , "valid-pass" ] )
135
- . skip_files ( skipped_files)
132
+ . skip_files ( & skipped_files)
136
133
// This test relies on old OP_QUERY behavior that many drivers still use for < 4.4, but
137
134
// we do not use, due to never implementing OP_QUERY.
138
135
. skip_tests ( & [ "A successful find event with a getmore and the server kills the cursor (<= 4.4)" ] )
0 commit comments