Skip to content

Commit

Permalink
Dump output as json
Browse files Browse the repository at this point in the history
  • Loading branch information
clarmso committed Feb 22, 2024
1 parent 3b0b788 commit bf2a2bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
uses: google-github-actions/upload-cloud-storage@v2
with:
path: '.'
glob: ./hello-*.txt
glob: ./testrail-backup-*.json
destination: backups-testrail-test-suites/

8 changes: 4 additions & 4 deletions testrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pandas as pd
import pprint
import json

from lib.testrail_conn import APIClient
from database import (
Expand Down Expand Up @@ -321,7 +322,6 @@ def report_test_runs_insert(self, project_id, payload):
# Put response to a file for uploading later
# print(response)
current = datetime.now().strftime("%Y-%m-%dT%H:%M:%S")
output_filename = "hello-{timestamp}.txt".format(timestamp = current)
output_file = open(output_filename, "w")
output_file.write(str(response)) # Not a csv yet
output_file.close()
output_filename = "testrail-backup-{timestamp}.json".format(timestamp = current)
with open(output_filename, "w") as output_file
json.dump(response, output_file)

0 comments on commit bf2a2bf

Please sign in to comment.