@@ -155,7 +155,7 @@ fn update_generated(sh: &Shell) -> Result<()> {
155
155
}
156
156
157
157
#[ context( "test-integration" ) ]
158
- fn test_tmt ( sh : & Shell ) -> Result < ( ) > {
158
+ fn all_plan_files ( sh : & Shell ) -> Result < Vec < ( u32 , String ) > > {
159
159
// We need to split most of our tests into separate plans because tmt doesn't
160
160
// support automatic isolation. (xref)
161
161
let mut all_plan_files =
@@ -187,13 +187,25 @@ fn test_tmt(sh: &Shell) -> Result<()> {
187
187
} ) ?;
188
188
all_plan_files. sort_by_key ( |v| v. 0 ) ;
189
189
println ! ( "Discovered plans: {all_plan_files:?}" ) ;
190
+ Ok ( all_plan_files)
191
+ }
192
+
193
+ #[ context( "test-integration" ) ]
194
+ fn test_tmt ( sh : & Shell ) -> Result < ( ) > {
195
+ let mut tests = all_plan_files ( sh) ?;
196
+ if let Ok ( name) = std:: env:: var ( "TMT_TEST" ) {
197
+ tests. retain ( |x| x. 1 . as_str ( ) == name) ;
198
+ if tests. is_empty ( ) {
199
+ anyhow:: bail!( "Failed to match test: {name}" ) ;
200
+ }
201
+ }
190
202
191
203
cmd ! ( sh, "cargo run -p tests-integration run-vm prepare-tmt" ) . run ( ) ?;
192
204
193
205
// pull some small images that are used for LBI installation tests
194
206
cmd ! ( sh, "podman pull {TEST_IMAGES...}" ) . run ( ) ?;
195
207
196
- for ( _prio, name) in all_plan_files {
208
+ for ( _prio, name) in tests {
197
209
// cc https://pagure.io/testcloud/pull-request/174
198
210
cmd ! ( sh, "rm -vf /var/tmp/tmt/testcloud/images/disk.qcow2" ) . run ( ) ?;
199
211
let verbose_enabled = std:: env:: var ( "TMT_VERBOSE" )
0 commit comments