Skip to content

Commit a043522

Browse files
committed
fix offline command for gradle and maven
1 parent 19429de commit a043522

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

‎gitbugactions/actions/java/gradle_workflow.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ def _is_test_command(self, command) -> bool:
2222
returnFalse
2323

2424
definstrument_test_steps(self):
25-
pass
25+
# Add an "--offline" option to the test command
26+
# FIXME: only when offline option is given
27+
if"jobs"inself.doc:
28+
for_, jobinself.doc["jobs"].items():
29+
if"steps"injob:
30+
forstepinjob["steps"]:
31+
if"run"instepandself._is_test_command(step["run"]):
32+
step["run"] +=" --offline"
2633

2734
defget_test_results(self, repo_path) ->List[TestCase]:
2835
parser=JUnitXMLParser()

‎gitbugactions/actions/java/maven_workflow.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ def _is_test_command(self, command) -> bool:
2222
returnFalse
2323

2424
definstrument_test_steps(self):
25-
pass
25+
# Add an "--offline" option to the test command
26+
# FIXME: only when offline option is given
27+
if"jobs"inself.doc:
28+
for_, jobinself.doc["jobs"].items():
29+
if"steps"injob:
30+
forstepinjob["steps"]:
31+
if"run"instepandself._is_test_command(step["run"]):
32+
step["run"] +=" -offline"
2633

2734
defget_test_results(self, repo_path) ->List[TestCase]:
2835
parser=JUnitXMLParser()

‎gitbugs/bug.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def number_of_tests(runs):
179179
return (
180180
len(runs) >0
181181
andlen(failed_tests) ==0
182-
andnumber_of_tests(runs) >0# TODO: check against the number of tests in the bug info
182+
andnumber_of_tests(runs)
183+
>0# TODO: check against the number of tests in the bug info
183184
)
184185

185186
def__str__(self) ->str:

0 commit comments

Comments
(0)