File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 api-key : ${{ secrets.GOOGLE_API_KEY }}
4343 readme-path : tests/sample_readme.md
4444 explanation-in : Korean
45+ fail-expected : True
4546 timeout-minutes : 5
4647
4748 - name : Output the outputs of the integration test of the action
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99### Added
1010* MECE principle in comment generation
1111* if failed, assert the error message
12+ * fail-expected argument to fail the test if the expected fail count not correct
1213
1314
1415### Changed
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ def main() -> None:
3333
3434 explanation_in = os .environ ['INPUT_EXPLANATION-IN' ]
3535
36+ b_fail_expected = ('true' == os .getenv ('INPUT_FAIL-EXPECTED' , 'false' ).lower ())
37+
3638 n_failed , feedback = ai_tutor .gemini_qna (
3739 report_files ,
3840 student_files ,
@@ -48,7 +50,12 @@ def main() -> None:
4850 out_string = f'feedback<<EOF\n { feedback } \n EOF'
4951 logging .info (f"Writing to GITHUB_OUTPUT: { f .write (out_string )} characters" )
5052
51- assert n_failed == 0 , f'{ n_failed } failed tests'
53+ if not b_fail_expected :
54+ assert n_failed == 0 , f'{ n_failed } failed tests'
55+ elif b_fail_expected :
56+ assert n_failed > 0 , 'No failed tests'
57+ else :
58+ raise NotImplementedError ('Unexpected value for INPUT_FAIL-EXPECTED' )
5259
5360
5461def get_path_tuple (report_files_str :str ) -> Tuple [pathlib .Path ]:
You can’t perform that action at this time.
0 commit comments