Skip to content

Commit c55542c

Browse files
Merge pull request #289 from rtCamp/add/report
Add tesults Integration
2 parents 1d129f3 + a05d722 commit c55542c

File tree

5 files changed

+553
-9
lines changed

5 files changed

+553
-9
lines changed

.github/workflows/e2e-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ jobs:
2323
# The type of runner that the job will run on
2424
name: Run nginx helper plugin test Cases
2525
runs-on: ubuntu-latest
26+
env:
27+
TESRESULT_TOKEN: ${{ secrets.TESRESULT_TOKEN }}
28+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
SHA: ${{ github.event.pull_request.head.sha }}
30+
COMMIT_SHA: ${{ github.sha }}
31+
PR_NUMBER: ${{ github.event.pull_request.number }}
32+
working-directory: ./tests/e2e-playwright
2633

2734
# Steps represent a sequence of tasks that will be executed as part of the job
2835
steps:
@@ -50,6 +57,11 @@ jobs:
5057
name: report
5158
path: ./tests/e2e-playwright/config
5259

60+
- name: run PR status
61+
if: ${{ always() }}
62+
run: node ./tests/e2e-playwright/bin/pr-status.js
63+
working-directory: ${{env.working_directory}}
64+
5365
- name: Cleanup
5466
if: ${{ always() }}
5567
uses: rtCamp/action-cleanup@master
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
// Octokit.js
3+
// https://github.com/octokit/core.js#readme
4+
5+
const { Octokit } = require("@octokit/core");
6+
7+
const octokit = new Octokit({
8+
auth: process.env.TOKEN,
9+
});
10+
11+
octokit.request("POST /repos/{org}/{repo}/statuses/{sha}", {
12+
org: "rtCamp",
13+
repo: "nginx-helper",
14+
sha: process.env.SHA ? process.env.SHA : process.env.COMMIT_SHA,
15+
state: "success",
16+
conclusion: "success",
17+
target_url:
18+
"https://www.tesults.com/results/rsp/view/results/project/9d774d35-a184-4bcd-af1e-5fc9c0cfe42a",
19+
description: "Successfully synced to Tesults",
20+
context: "E2E Test Result",
21+
});

0 commit comments

Comments
 (0)