Skip to content

Commit

Permalink
Attach failed test stories & fix cross_validation_results.py failure (
Browse files Browse the repository at this point in the history
#22)

* initial changes

* remove classes

* append only on failure

* test

* class remove

* data.pop
  • Loading branch information
rgstephens authored Aug 28, 2023
1 parent 63f1556 commit 9350056
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rasa-demo
results.json
report_main.json
.history
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ runs:
OUTPUT="${OUTPUT}\n$(python3 ${{ github.action_path }}/scripts/cross_validation_results.py)"
fi
if [[ -f "${{ inputs.workspace }}/${{ inputs.result_directory }}/failed_test_stories.yml" ]]; then
TEST_FAILED=$(grep 'None of the test stories failed' README.md > /dev/null; echo $?)
if [[ $TEST_FAILED -eq 0 ]]; then
OUTPUT="${OUTPUT}\n```yml\n$(cat ${{ inputs.workspace }}/${{ inputs.result_directory }}/failed_test_stories.yml)```"
else
OUTPUT="${OUTPUT}\n\n#$(cat ${{ inputs.workspace }}/${{ inputs.result_directory }}/failed_test_stories.yml)"
fi
fi
OUTPUT="${OUTPUT//$'\n'/'\n'}"
curl -X POST -s -H "Authorization: token ${{ inputs.github_token }}" -H "Accept: application/vnd.github.v3+json" \
Expand Down
1 change: 1 addition & 0 deletions scripts/cross_validation_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def entity_table():
cols = ["support", "f1-score", "precision", "recall"]
writer.headers = ["entity"] + cols

data.pop("accuracy", None)
classes = list(data.keys())
classes.sort(key=lambda x: data[x]["support"], reverse=True)

Expand Down

0 comments on commit 9350056

Please sign in to comment.