1414)
1515
1616
17+ BUILD_RUNNING_STRING = "Running build for recipe:"
18+
19+
1720def test_build_conda_package (
1821 pixi : Path ,
1922 simple_workspace : Workspace ,
@@ -48,17 +51,15 @@ def test_no_change_should_be_fully_cached(pixi: Path, simple_workspace: Workspac
4851 "-v" ,
4952 "--manifest-path" ,
5053 simple_workspace .workspace_dir ,
51- ]
54+ ],
55+ stderr_contains = BUILD_RUNNING_STRING ,
5256 )
5357
54- conda_output_params = simple_workspace .debug_dir .joinpath ("conda_outputs_params.json" )
55- conda_build_params = simple_workspace .debug_dir .joinpath ("conda_build_v1_params.json" )
58+ conda_build_params = simple_workspace .find_debug_file ("conda_build_v1_params.json" )
5659
57- assert conda_output_params .is_file ()
58- assert conda_build_params .is_file ()
60+ assert conda_build_params is not None
5961
6062 # Remove the files to get a clean state
61- conda_output_params .unlink ()
6263 conda_build_params .unlink ()
6364
6465 verify_cli_command (
@@ -68,18 +69,19 @@ def test_no_change_should_be_fully_cached(pixi: Path, simple_workspace: Workspac
6869 "-v" ,
6970 "--manifest-path" ,
7071 simple_workspace .workspace_dir ,
71- ]
72+ ],
73+ stderr_excludes = BUILD_RUNNING_STRING ,
7274 )
7375
74- # Everything should be cached, so no getMetadata or build call
75- assert not conda_output_params .is_file ()
76- assert not conda_build_params .is_file ()
76+ # Everything should be cached, so no build call,
77+ assert simple_workspace .find_debug_file ("conda_build_v1_params.json" ) is None
7778
7879
7980def test_recipe_change_trigger_metadata_invalidation (
8081 pixi : Path , simple_workspace : Workspace
8182) -> None :
8283 simple_workspace .write_files ()
84+
8385 verify_cli_command (
8486 [
8587 pixi ,
@@ -88,15 +90,9 @@ def test_recipe_change_trigger_metadata_invalidation(
8890 "--manifest-path" ,
8991 simple_workspace .workspace_dir ,
9092 ],
93+ stderr_contains = BUILD_RUNNING_STRING ,
9194 )
9295
93- conda_output_params = simple_workspace .debug_dir .joinpath ("conda_outputs_params.json" )
94-
95- assert conda_output_params .is_file ()
96-
97- # Remove the conda build params to get a clean state
98- conda_output_params .unlink ()
99-
10096 # Touch the recipe
10197 simple_workspace .recipe_path .touch ()
10298
@@ -108,11 +104,9 @@ def test_recipe_change_trigger_metadata_invalidation(
108104 "--manifest-path" ,
109105 simple_workspace .workspace_dir ,
110106 ],
107+ stderr_contains = BUILD_RUNNING_STRING ,
111108 )
112109
113- # Touching the recipe should trigger a rebuild and therefore create the file
114- assert conda_output_params .is_file ()
115-
116110
117111def test_project_model_change_trigger_rebuild (
118112 pixi : Path , simple_workspace : Workspace , dummy_channel_1 : Path
@@ -126,19 +120,19 @@ def test_project_model_change_trigger_rebuild(
126120 "--manifest-path" ,
127121 simple_workspace .workspace_dir ,
128122 ],
123+ stderr_contains = BUILD_RUNNING_STRING ,
129124 )
130125
131- conda_build_params = simple_workspace .debug_dir .joinpath ("conda_build_v1_params.json" )
132-
133- assert conda_build_params .is_file ()
126+ conda_build_params = simple_workspace .find_debug_file ("conda_build_v1_params.json" )
127+ assert conda_build_params is not None
134128
135129 # Remove the conda build params to get a clean state
136130 conda_build_params .unlink ()
137131
138132 # modify extra-input-globs
139- simple_workspace .package_manifest ["package" ]["build" ][ "configuration" ] .setdefault (
140- "extra-input-globs " , [ "*.md" ]
141- )
133+ simple_workspace .package_manifest ["package" ]["build" ].setdefault (
134+ "configuration " , dict ()
135+ ). setdefault ( "extra-input-globs" , [ "*.md" ])
142136 simple_workspace .write_files ()
143137 verify_cli_command (
144138 [
@@ -148,10 +142,11 @@ def test_project_model_change_trigger_rebuild(
148142 "--manifest-path" ,
149143 simple_workspace .workspace_dir ,
150144 ],
145+ stderr_contains = BUILD_RUNNING_STRING ,
151146 )
152147
153148 # modifying the project model should trigger a rebuild and therefore create a file
154- assert conda_build_params . is_file ()
149+ assert simple_workspace . find_debug_file ( "conda_build_v1_params.json" ) is not None
155150
156151
157152@pytest .mark .slow
0 commit comments