Skip to content

Commit 3b656e3

Browse files
committed
testing
1 parent b124017 commit 3b656e3

File tree

3 files changed

+214
-5
lines changed

3 files changed

+214
-5
lines changed

.github/workflows/int.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build-and-test
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
schedule:
11+
- cron: '0 2 * * *'
12+
13+
jobs:
14+
build-and-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Build
22+
run: npm run all:action
23+
- name: Publish Test Report
24+
uses: ctrf-io/github-test-reporter@v1
25+
with:
26+
report-path: './ctrf/*.json'
27+
integrations-config: |
28+
{
29+
"slack": {
30+
"enabled": true,
31+
"action": "results",
32+
},
33+
"teams": {
34+
"enabled": true,
35+
"action": "results",
36+
},
37+
"ai": {
38+
"enabled": true,
39+
"action": "openai",
40+
}
41+
}
42+
env:
43+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
45+
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ Checkout the built-in reports [here](docs/report-showcase.md)
7272
6. [GitHub Token](#github-token)
7373
7. [Storing Artifacts](#storing-artifacts)
7474
8. [Filtering](#filtering)
75-
9. [Generating an AI Report](#generating-an-ai-report)
76-
10. [Run With NPX](#run-with-npx)
77-
11. [Report Showcase](#report-showcase)
78-
12. [What is CTRF?](#what-is-ctrf)
75+
9. [Integrations](#integrations)
76+
10. [Generating an AI Report](#generating-an-ai-report)
77+
11. [Run With NPX](#run-with-npx)
78+
12. [Report Showcase](#report-showcase)
79+
13. [What is CTRF?](#what-is-ctrf)
7980

8081
## Usage
8182

@@ -213,14 +214,15 @@ input and providing the issue number ():
213214
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214215
if: always()
215216
```
217+
216218
**Note:** Special considerations apply to pull requests from forks. See [Fork Pull Requests](docs/fork-pull-requests.md) for details.
217219

218220
### Comment Management Inputs
219221

220222
`--update-comment` An existing tagged comment is found, the new report is
221223
appended to it. Otherwise, a new comment is created.
222224

223-
`--overwrite-comment` An existing tagged comment is found, that comments entire
225+
`--overwrite-comment` An existing tagged comment is found, that comment's entire
224226
content is replaced with the new report. Otherwise, a new comment is created.
225227

226228
`--comment-tag` A unique identifier for comments posted. Used to find and
@@ -332,6 +334,20 @@ previous results as follows:
332334
This ensures that you only see workflow runs that are related to your current
333335
branch or pull request
334336

337+
## Integrations
338+
339+
CTRF tooling offers seamless developer tool integration, allowing you to combine the GitHub Test Reporter with the following tools:
340+
341+
| Integration | Description | Repository |
342+
|------------|-------------|------------|
343+
| Slack Test Reporter | Send test results and notifications to Slack channels | [ctrf-io/slack-test-reporter](https://github.com/ctrf-io/slack-test-reporter) |
344+
| Microsoft Teams Test Reporter | Post test results and alerts to Teams channels | [ctrf-io/teams-test-reporter](https://github.com/ctrf-io/teams-test-reporter) |
345+
| AI Test Reporter | Intelligent test analysis using leading AI models | [ctrf-io/ai-test-reporter](https://github.com/ctrf-io/ai-test-reporter) |
346+
347+
For detailed information about configuring and using these integrations, see our [Integrations Documentation](docs/integrations.md).
348+
349+
To suggest a new integration, please open an issue on the [GitHub Test Reporter repository](https://github.com/ctrf-io/github-test-reporter/issues).
350+
335351
## Generating an AI Report
336352

337353
You can generate human-readable AI report for your failed tests using models

docs/integrations.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Integrations
2+
3+
GitHub Test Reporter supports various integrations to enhance your test reporting workflow. These integrations allow you to seamlessly combine the GitHub Test Reporter with popular developer tools.
4+
5+
You can use multiple integrations in the same workflow.
6+
7+
Integrations are currently beta. Please report any issues to the [GitHub Test Reporter repository](https://github.com/ctrf-io/github-test-reporter/issues).
8+
9+
| Integration | Description | Repository |
10+
|------------|-------------|------------|
11+
| Slack Test Reporter | Send test results and notifications to Slack channels | [ctrf-io/slack-test-reporter](https://github.com/ctrf-io/slack-test-reporter) |
12+
| Microsoft Teams Test Reporter | Post test results and alerts to Teams channels | [ctrf-io/teams-test-reporter](https://github.com/ctrf-io/teams-test-reporter) |
13+
| AI Test Reporter | Intelligent test analysis using leading AI models | [ctrf-io/ai-test-reporter](https://github.com/ctrf-io/ai-test-reporter) |
14+
15+
For detailed information about configuring and using these integrations, see our [Integrations Documentation](docs/integrations.md).
16+
17+
To suggest a new integration, please open an issue on the [GitHub Test Reporter repository](https://github.com/ctrf-io/github-test-reporter/issues).
18+
19+
## Configuration
20+
21+
Integrations are configured using the `integrations-config` input in your GitHub Actions workflow. The configuration is passed as a JSON string:
22+
23+
```yaml
24+
- name: Publish Test Report
25+
uses: ctrf-io/github-test-reporter@v1
26+
with:
27+
report-path: './ctrf/*.json'
28+
integrations-config: |
29+
{
30+
"slack": {
31+
"enabled": true,
32+
"action": "results",
33+
},
34+
"teams": {
35+
"enabled": true,
36+
"action": "results",
37+
},
38+
"ai": {
39+
"enabled": true,
40+
"action": "openai",
41+
}
42+
}
43+
env:
44+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
45+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
46+
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
47+
```
48+
49+
## Available Integrations
50+
51+
### Slack Integration
52+
53+
The Slack integration allows you to send test results directly to your Slack channels.
54+
55+
The Slack integration is powered by the [Slack Test Reporter](https://github.com/ctrf-io/slack-test-reporter), see the latest documentation for more information.
56+
57+
#### Configuration Options
58+
59+
```yaml
60+
- name: Publish Test Report
61+
uses: ctrf-io/github-test-reporter@v1
62+
with:
63+
report-path: './ctrf/*.json'
64+
integrations-config: |
65+
{
66+
"slack": {
67+
"enabled": true,
68+
"action": "results", # One of: "results" | "ai" | "failed" | "flaky"
69+
"options": {
70+
"title": "Test Results",
71+
"prefix": "Custom prefix",
72+
"suffix": "Custom suffix",
73+
"consolidated": false,
74+
"onFailOnly": false
75+
}
76+
}
77+
}
78+
env:
79+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
80+
if: always()
81+
```
82+
83+
See the [Slack Test Reporter](https://github.com/ctrf-io/slack-test-reporter) for more information.
84+
85+
### Microsoft Teams Integration
86+
87+
The Microsoft Teams integration allows you to send test results directly to your Microsoft Teams channels.
88+
89+
The Microsoft Teams integration is powered by the [Microsoft Teams Test Reporter](https://github.com/ctrf-io/teams-test-reporter), see the documentation for more information.
90+
91+
```yaml
92+
- name: Publish Test Report
93+
uses: ctrf-io/github-test-reporter@v1
94+
with:
95+
report-path: './ctrf/*.json'
96+
integrations-config: |
97+
{
98+
"teams": {
99+
"enabled": true,
100+
"action": "results", // One of: "results" | "flaky" | "ai"
101+
"options": {
102+
"title": "Test Results",
103+
"onFailOnly": false
104+
}
105+
}
106+
}
107+
env:
108+
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
109+
if: always()
110+
```
111+
112+
See the [Microsoft Teams Test Reporter](https://github.com/ctrf-io/teams-test-reporter) for more information.
113+
114+
### AI Integration
115+
116+
The AI integration provides intelligent analysis of your test results using advanced AI models.
117+
118+
The AI integration is powered by the [AI Test Reporter](https://github.com/ctrf-io/ai-test-reporter), see the latestdocumentation for more information.
119+
120+
```yaml
121+
- name: Publish Test Report
122+
uses: ctrf-io/github-test-reporter@v1
123+
with:
124+
report-path: './ctrf/*.json'
125+
integrations-config: |
126+
{
127+
"ai": {
128+
"enabled": true,
129+
"action": "openai", // One of: "openai" | "claude" | "azure-openai" | "grok" | "deepseek" | "mistral" | "gemini" | "perplexity" | "openrouter"
130+
"options": {
131+
"model": "gpt-4",
132+
"systemPrompt": "Custom system prompt",
133+
"frequencyPenalty": 0,
134+
"maxTokens": 1000,
135+
"presencePenalty": 0,
136+
"temperature": 0.7,
137+
"topP": 1,
138+
"log": false,
139+
"maxMessages": 10,
140+
"consolidate": false,
141+
"deploymentId": "your-azure-deployment-id"
142+
}
143+
}
144+
}
145+
env:
146+
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
147+
if: always()
148+
```

0 commit comments

Comments
 (0)