@@ -54,32 +54,32 @@ def test_build_as_code_check(
5454
5555 # The target repo uses Maven build tool but does not deploy artifacts.
5656 use_build_tool = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
57- use_build_tool .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
57+ use_build_tool .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
5858 assert check .run_check (use_build_tool , check_result ) == CheckResultType .FAILED
5959
6060 # The target repo uses Gradle build tool but does not deploy artifacts.
6161 use_build_tool = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
62- use_build_tool .dynamic_data ["build_spec" ]["tool " ] = [gradle_tool ]
62+ use_build_tool .dynamic_data ["build_spec" ]["tools " ] = [gradle_tool ]
6363 assert check .run_check (use_build_tool , check_result ) == CheckResultType .FAILED
6464
6565 # The target repo uses Poetry build tool but does not deploy artifacts.
6666 use_build_tool = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
67- use_build_tool .dynamic_data ["build_spec" ]["tool " ] = [poetry_tool ]
67+ use_build_tool .dynamic_data ["build_spec" ]["tools " ] = [poetry_tool ]
6868 assert check .run_check (use_build_tool , check_result ) == CheckResultType .FAILED
6969
7070 # The target repo uses Pip build tool but does not deploy artifacts.
7171 use_build_tool = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
72- use_build_tool .dynamic_data ["build_spec" ]["tool " ] = [pip_tool ]
72+ use_build_tool .dynamic_data ["build_spec" ]["tools " ] = [pip_tool ]
7373 assert check .run_check (use_build_tool , check_result ) == CheckResultType .FAILED
7474
7575 # The target repo does not use a build tool.
7676 no_build_tool = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
77- no_build_tool .dynamic_data ["build_spec" ]["tool " ] = []
77+ no_build_tool .dynamic_data ["build_spec" ]["tools " ] = []
7878 assert check .run_check (no_build_tool , check_result ) == CheckResultType .FAILED
7979
8080 # Use mvn deploy to deploy the artifact.
8181 maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
82- maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
82+ maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
8383 bash_commands ["commands" ] = [["mvn" , "deploy" ]]
8484 maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
8585 assert check .run_check (maven_deploy , check_result ) == CheckResultType .PASSED
@@ -96,7 +96,7 @@ def test_build_as_code_check(
9696
9797 # Use mvn but do not deploy artifacts.
9898 no_maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
99- no_maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
99+ no_maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
100100 bash_commands ["commands" ] = [["mvn" , "verify" ]]
101101 no_maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
102102 assert check .run_check (no_maven_deploy , check_result ) == CheckResultType .FAILED
@@ -108,66 +108,66 @@ def test_build_as_code_check(
108108
109109 # Use gradle to deploy the artifact.
110110 gradle_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
111- gradle_deploy .dynamic_data ["build_spec" ]["tool " ] = [gradle_tool ]
111+ gradle_deploy .dynamic_data ["build_spec" ]["tools " ] = [gradle_tool ]
112112 bash_commands ["commands" ] = [["./gradlew" , "publishToSonatype" ]]
113113 gradle_deploy .dynamic_data ["ci_services" ] = [ci_info ]
114114 assert check .run_check (gradle_deploy , check_result ) == CheckResultType .PASSED
115115
116116 # Use poetry publish to publish the artifact.
117117 poetry_publish = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
118- poetry_publish .dynamic_data ["build_spec" ]["tool " ] = [poetry_tool ]
118+ poetry_publish .dynamic_data ["build_spec" ]["tools " ] = [poetry_tool ]
119119 bash_commands ["commands" ] = [["poetry" , "publish" ]]
120120 poetry_publish .dynamic_data ["ci_services" ] = [ci_info ]
121121 assert check .run_check (poetry_publish , check_result ) == CheckResultType .PASSED
122122
123123 # Use Poetry but do not deploy artifacts.
124124 no_poetry_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
125- no_poetry_deploy .dynamic_data ["build_spec" ]["tool " ] = [poetry_tool ]
125+ no_poetry_deploy .dynamic_data ["build_spec" ]["tools " ] = [poetry_tool ]
126126 bash_commands ["commands" ] = [["poetry" , "upload" ]]
127127 no_poetry_deploy .dynamic_data ["ci_services" ] = [ci_info ]
128128 assert check .run_check (no_maven_deploy , check_result ) == CheckResultType .FAILED
129129
130130 # Use twine upload to deploy the artifact.
131131 twine_upload = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
132- twine_upload .dynamic_data ["build_spec" ]["tool " ] = [pip_tool ]
132+ twine_upload .dynamic_data ["build_spec" ]["tools " ] = [pip_tool ]
133133 bash_commands ["commands" ] = [["twine" , "upload" , "dist/*" ]]
134134 twine_upload .dynamic_data ["ci_services" ] = [ci_info ]
135135 assert check .run_check (twine_upload , check_result ) == CheckResultType .PASSED
136136
137137 # Use flit publish to deploy the artifact.
138138 flit_publish = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
139- flit_publish .dynamic_data ["build_spec" ]["tool " ] = [pip_tool ]
139+ flit_publish .dynamic_data ["build_spec" ]["tools " ] = [pip_tool ]
140140 bash_commands ["commands" ] = [["flit" , "publish" ]]
141141 flit_publish .dynamic_data ["ci_services" ] = [ci_info ]
142142 assert check .run_check (flit_publish , check_result ) == CheckResultType .PASSED
143143
144144 # Test Jenkins.
145145 maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
146- maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
146+ maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
147147 ci_info ["service" ] = jenkins_service
148148 bash_commands ["commands" ] = []
149149 maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
150150 assert check .run_check (maven_deploy , check_result ) == CheckResultType .FAILED
151151
152152 # Test Travis.
153153 maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
154- maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
154+ maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
155155 ci_info ["service" ] = travis_service
156156 bash_commands ["commands" ] = []
157157 maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
158158 assert check .run_check (maven_deploy , check_result ) == CheckResultType .FAILED
159159
160160 # Test Circle CI.
161161 maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
162- maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
162+ maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
163163 ci_info ["service" ] = circle_ci_service
164164 bash_commands ["commands" ] = []
165165 maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
166166 assert check .run_check (maven_deploy , check_result ) == CheckResultType .FAILED
167167
168168 # Test GitLab CI.
169169 maven_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
170- maven_deploy .dynamic_data ["build_spec" ]["tool " ] = [maven_tool ]
170+ maven_deploy .dynamic_data ["build_spec" ]["tools " ] = [maven_tool ]
171171 ci_info ["service" ] = gitlab_ci_service
172172 bash_commands ["commands" ] = []
173173 maven_deploy .dynamic_data ["ci_services" ] = [ci_info ]
@@ -222,7 +222,7 @@ def test_gha_workflow_deployment(
222222
223223 # This Github Actions workflow uses gh-action-pypi-publish to publish the artifact.
224224 gha_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
225- gha_deploy .dynamic_data ["build_spec" ]["tool " ] = [pip_tool ]
225+ gha_deploy .dynamic_data ["build_spec" ]["tools " ] = [pip_tool ]
226226 gha_deploy .dynamic_data ["ci_services" ] = [ci_info ]
227227
228228 root = GitHubNode (name = "root" , node_type = GHWorkflowType .NONE , source_path = "" , parsed_obj = {}, caller_path = "" )
@@ -283,7 +283,7 @@ def test_travis_ci_deploy(
283283 check_result = CheckResult (justification = []) # type: ignore
284284 gradle_deploy = MockAnalyzeContext (macaron_path = macaron_path , output_dir = "" )
285285 gradle_deploy .component .repository .fs_path = str (repo_path .absolute ())
286- gradle_deploy .dynamic_data ["build_spec" ]["tool " ] = [gradle_tool ]
286+ gradle_deploy .dynamic_data ["build_spec" ]["tools " ] = [gradle_tool ]
287287 gradle_deploy .dynamic_data ["ci_services" ] = [ci_info ]
288288
289289 assert check .run_check (gradle_deploy , check_result ) == expect_result
0 commit comments