Skip to content

Commit

Permalink
Merge pull request #138 from rtCamp/add/tesults
Browse files Browse the repository at this point in the history
Add tesults Integration
  • Loading branch information
pooja-muchandikar authored Dec 6, 2022
2 parents b6ecdd4 + 0b33a7d commit 0c4ee9c
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
env:
GMAIL_UNAME: ${{ secrets.GMAIL_UNAME }}
GMAIL_PASS: ${{ secrets.GMAIL_PASS }}
TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHA: ${{ github.event.pull_request.head.sha }}
COMMIT_SHA: ${{ github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
working-directory: ./tests/e2e-playwright

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -52,6 +58,11 @@ jobs:
name: report
path: ./tests/e2e-playwright/uploads

- name: run PR status
if: ${{ always() }}
run: node ./tests/e2e-playwright/bin/pr-status.js
working-directory: ${{env.working_directory}}

- name: Cleanup
if: ${{ always() }}
uses: rtCamp/action-cleanup@master
21 changes: 21 additions & 0 deletions tests/e2e-playwright/bin/pr-status.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
// Octokit.js
// https://github.com/octokit/core.js#readme

const { Octokit } = require("@octokit/core");

const octokit = new Octokit({
auth: process.env.TOKEN,
});

octokit.request("POST /repos/{org}/{repo}/statuses/{sha}", {
org: "rtCamp",
repo: "login-with-google",
sha: process.env.SHA ? process.env.SHA : process.env.COMMIT_SHA,
state: "success",
conclusion: "success",
target_url:
"https://www.tesults.com/results/rsp/view/results/project/f121e5a9-27dd-4c39-85d3-1c138bbed9e8",
description: "Successfully synced to Tesults",
context: "E2E Test Result",
});
Loading

0 comments on commit 0c4ee9c

Please sign in to comment.