File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -111,15 +111,25 @@ impl TestProject {
111
111
}
112
112
fn cmd ( & self ) -> Command {
113
113
let mut command = Command :: new ( env ! ( "CARGO_BIN_EXE_cargo-insta" ) ) ;
114
+ // Remove environment variables so we don't inherit anything (such as
115
+ // `INSTA_FORCE_PASS` or `CARGO_INSTA_*`) from a cargo-insta process
116
+ // which runs this integration test.
117
+ for ( key, _) in env:: vars ( ) {
118
+ if key. starts_with ( "CARGO_INSTA" ) || key. starts_with ( "INSTA" ) {
119
+ command. env_remove ( & key) ;
120
+ }
121
+ }
122
+ // Turn off CI flag so that cargo insta test behaves as we expect
123
+ // under normal operation
124
+ command. env ( "CI" , "0" ) ;
125
+
114
126
command. current_dir ( self . workspace_dir . as_path ( ) ) ;
115
127
// Use the same target directory as other tests, consistent across test
116
128
// run. This makes the compilation much faster (though do some tests
117
129
// tread on the toes of others? We could have a different cache for each
118
130
// project if so...)
119
131
command. env ( "CARGO_TARGET_DIR" , target_dir ( ) ) ;
120
- // Turn off CI flag so that cargo insta test behaves as we expect
121
- // under normal operation
122
- command. env ( "CI" , "0" ) ;
132
+
123
133
command
124
134
}
125
135
You can’t perform that action at this time.
0 commit comments