Skip to content

Commit 38f4864

Browse files
authored
fix nightly test report (#414)
1 parent a8d9a2f commit 38f4864

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

scripts/gha/it_workflow.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@
7878
_BUILD_STAGES_REPORT = "report"
7979
_BUILD_STAGES = [_BUILD_STAGES_START, _BUILD_STAGES_PROGRESS, _BUILD_STAGES_END, _BUILD_STAGES_REPORT]
8080

81-
_BUILD_AGAINST_SDK = "sdk"
82-
_BUILD_AGAINST_REPO = "repo"
83-
8481
FLAGS = flags.FLAGS
8582

8683
flags.DEFINE_string(
@@ -112,10 +109,6 @@
112109
"Use a different token to remove the \"in-progress\" label,"
113110
"to allow the removal to trigger the \"Check Labels\" workflow.")
114111

115-
flags.DEFINE_string(
116-
"build_against", None,
117-
"Integration testapps could either build against packaged SDK or repo")
118-
119112

120113
def test_start(token, issue_number, actor, commit, run_id):
121114
"""In PR, when start testing, add comment and label \"tests: in-progress\""""
@@ -181,29 +174,26 @@ def test_end(token, issue_number, actor, commit, run_id, new_token):
181174
github.delete_label(new_token, issue_number, _LABEL_PROGRESS)
182175

183176

184-
def test_report(token, actor, commit, run_id, build_against):
177+
def test_report(token, actor, commit, run_id):
185178
"""Update (create if not exist) a Daily Report in Issue.
186179
The Issue with title _REPORT_TITLE and label _REPORT_LABEL:
187180
https://github.com/firebase/firebase-unity-sdk/issues?q=is%3Aissue+label%3Anightly-testing
188181
"""
189182
issue_number = _get_issue_number(token, _REPORT_TITLE, _REPORT_LABEL)
190-
previous_comment = github.get_issue_body(token, issue_number)
191-
[previous_comment_repo, previous_comment_sdk] = previous_comment.split(_COMMENT_SUFFIX)
192183
success_or_only_flakiness, log_summary = _get_summary_table(token, run_id)
193-
if success_or_only_flakiness and not log_summary:
194-
# succeeded (without flakiness)
195-
title = _COMMENT_TITLE_SUCCEED
196-
comment = title + _get_description(actor, commit, run_id)
184+
if success_or_only_flakiness:
185+
if not log_summary:
186+
# succeeded (without flakiness)
187+
title = _COMMENT_TITLE_SUCCEED
188+
comment = title + _get_description(actor, commit, run_id)
189+
else:
190+
title = _COMMENT_TITLE_FLAKY
191+
comment = title + _get_description(actor, commit, run_id) + log_summary
197192
else:
198-
title = _COMMENT_TITLE_FLAKY
193+
title = _COMMENT_TITLE_FAIL
199194
comment = title + _get_description(actor, commit, run_id) + log_summary
200-
201-
if build_against==_BUILD_AGAINST_REPO:
202-
comment = comment + _COMMENT_SUFFIX + previous_comment_sdk
203-
else:
204-
comment = previous_comment_repo + _COMMENT_SUFFIX + comment
205195

206-
if _COMMENT_TITLE_SUCCEED:
196+
if title == _COMMENT_TITLE_SUCCEED:
207197
github.close_issue(token, issue_number)
208198
else:
209199
github.open_issue(token, issue_number)
@@ -272,7 +262,7 @@ def main(argv):
272262
elif FLAGS.stage == _BUILD_STAGES_END:
273263
test_end(FLAGS.token, FLAGS.issue_number, FLAGS.actor, FLAGS.commit, FLAGS.run_id, FLAGS.new_token)
274264
elif FLAGS.stage == _BUILD_STAGES_REPORT:
275-
test_report(FLAGS.token, FLAGS.actor, FLAGS.commit, FLAGS.run_id, FLAGS.build_against)
265+
test_report(FLAGS.token, FLAGS.actor, FLAGS.commit, FLAGS.run_id)
276266
else:
277267
print("Invalid stage value. Valid value: " + ",".join(_BUILD_STAGES))
278268

0 commit comments

Comments
 (0)