@@ -136,7 +136,7 @@ impl IntegrationTest {
136
136
}
137
137
138
138
struct Compose {
139
- path : PathBuf ,
139
+ original_path : PathBuf ,
140
140
test_dir : PathBuf ,
141
141
env : Environment ,
142
142
#[ cfg( unix) ]
@@ -147,14 +147,14 @@ struct Compose {
147
147
148
148
impl Compose {
149
149
fn new ( test_dir : PathBuf , env : Environment , network : String ) -> Result < Option < Self > > {
150
- let path : PathBuf = [ & test_dir, Path :: new ( "compose.yaml" ) ] . iter ( ) . collect ( ) ;
150
+ let original_path : PathBuf = [ & test_dir, Path :: new ( "compose.yaml" ) ] . iter ( ) . collect ( ) ;
151
151
152
- match path . try_exists ( ) {
153
- Err ( error) => Err ( error) . with_context ( || format ! ( "Could not lookup {path :?}" ) ) ,
152
+ match original_path . try_exists ( ) {
153
+ Err ( error) => Err ( error) . with_context ( || format ! ( "Could not lookup {original_path :?}" ) ) ,
154
154
Ok ( false ) => Ok ( None ) ,
155
155
Ok ( true ) => {
156
156
#[ cfg( unix) ]
157
- let mut config = ComposeConfig :: parse ( & path ) ?;
157
+ let mut config = ComposeConfig :: parse ( & original_path ) ?;
158
158
159
159
// Inject the networks block
160
160
config. networks . insert (
@@ -178,7 +178,7 @@ impl Compose {
178
178
) ?;
179
179
180
180
Ok ( Some ( Self {
181
- path ,
181
+ original_path ,
182
182
test_dir,
183
183
env,
184
184
#[ cfg( unix) ]
@@ -209,11 +209,11 @@ impl Compose {
209
209
// needs to use the calculated path from the integration name instead of the nonexistent
210
210
// tempfile path. This is because `stop` doesn't go through the same logic as `start`
211
211
// and doesn't create a new tempfile before calling docker compose.
212
+ // If stop command needs to use some of the injected bits then we need to rebuild it
213
+ command. arg ( "--file" ) ;
212
214
if config. is_none ( ) {
213
- command. arg ( "--file" ) ;
214
- command. arg ( & self . path ) ;
215
+ command. arg ( & self . original_path ) ;
215
216
} else {
216
- command. arg ( "--file" ) ;
217
217
command. arg ( self . temp_file . path ( ) ) ;
218
218
}
219
219
0 commit comments