Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a43ccf

Browse files
authored
Merge pull request #8 from RapidAPI/add-tenancy-support
Add tenancy support
2 parents b5adafb + 8b46040 commit 9a43ccf

File tree

8 files changed

+346
-48
lines changed

8 files changed

+346
-48
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Description
2+
3+
> *For `description`, provide a brief explanation of the context around this change.*
4+
5+
## Verification
6+
7+
> *Include screenshots, log messages, etc. to show how this change was tested/verified.*
8+
9+
## Ready for Code Review Checklist
10+
11+
- [ ] Includes unit tests
12+
- [ ] Includes related documentation

.github/release.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
authors:
6+
- octocat
7+
categories:
8+
- title: 🛠 Breaking Changes 🛠
9+
labels:
10+
- Version-Major
11+
- title: 🎉 Enhancements 🎉
12+
labels:
13+
- Version-Minor
14+
- title: 🩹 Patches 🩹
15+
labels:
16+
- Version-Patch
17+
- title: 📖 Documentation 📖
18+
labels:
19+
- documentation
20+
- title: 🤷 Other Changes 🤷
21+
labels:
22+
- "*"

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# RapidAPI Testing GitHub Actions
22

3-
This GitHub Action allows you to trigger the execution of [RapidAPI Testing](https://rapidapi.com/testing) tests.
3+
This GitHub Action allows you to trigger the execution of [RapidAPI Testing](https://rapidapi.com/testing) tests. This is especially useful
4+
during CI/CD to ensure new deployments are functioning as expected.
45

56
## Complete example
67

@@ -26,9 +27,11 @@ jobs:
2627
## Inputs
2728
2829
### `test`
30+
2931
**Required** The ID of the test you wish to execute.
3032

3133
### `location`
34+
3235
**Required** The location the test will be executed in. Options:
3336

3437
- `AWS-US-EAST-1` : N. Virginia
@@ -42,21 +45,39 @@ jobs:
4245
- `AWS-SA-EAST-1` : São Paulo
4346

4447
### `environment`
48+
4549
The environment you want to run the test in. If you don't use environment omit this parameter
4650

51+
### `tenant`
52+
53+
The tenant to run the test against. Defaults to the public Hub `rapidapi.com`. For example for an enterprise
54+
it may be `tenant: ${ENTERPRISE_DOMAIN}.hub.rapidapi.com`. Likewise, for different regions:
55+
56+
```yaml
57+
US: https://acme.hub.rapidapi.com
58+
CA: https://acme.hub-ca.rapidapi.com
59+
EU: https://acme.hub-eu.rapidapi.com
60+
```
61+
62+
With `acme` being a mock domain used as an example.
4763
## Outputs
4864

4965
### `time`
66+
5067
The time it took the test to execute, in milliseconds (1000ms=s)
5168

5269
### `successful`
70+
5371
True/false based on the result of the test execution
5472

5573
### `reportUrl`
74+
5675
URL of a human-readable report of the test execution
5776

5877
### `computedStatus`
78+
5979
A human-readable test status that matches the status values on the test dashboard in the UI
6080

6181
## Help
62-
For any help using this integration, reach out to `[email protected]`. You can also see RapidAPI Testing Guide in our [Help Center](https://docs.rapidapi.com/docs/creating-test-flows).
82+
83+
For any help using this integration, reach out to `[email protected]`. You can also see RapidAPI Testing Guide in our [Help Center](https://docs.rapidapi.com/docs/creating-test-flows).

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
description: 'The location the test will be executed in'
1212
required: true
1313
default: 'AWS-US-EAST-1'
14+
tenant:
15+
description: 'The Rapid tenant to run the tests against'
16+
required: false
17+
default: 'rapidapi.com'
1418
environment:
1519
description: 'The environment ID the test will run in'
1620
required: false
@@ -22,5 +26,5 @@ outputs:
2226
reportUrl:
2327
description: 'Url for the full test execution URL'
2428
runs:
25-
using: 'node12'
29+
using: 'node16'
2630
main: 'index.js'

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const axios = require('axios');
66
const WAIT_TIME = 1000;
77
const MAX_TRIES = 300;
88
const FIRST_WAIT = 2000;
9-
const API_URL = "https://rapidapi.com/testing/api/trigger";
109

1110
// INPUTS
1211
const TEST_ID = core.getInput('test');
@@ -18,6 +17,8 @@ console.log(`Executing In Location: ${LOCATION}`);
1817
const ENVIRONMENT = core.getInput('environment') || null;
1918
console.log(`Executing In Env: ${ENVIRONMENT}`);
2019

20+
const API_URL = `https://${core.getInput('tenant')}/testing/api/trigger`;
21+
console.log(`Executing Test Against: ${API_URL}`);
2122

2223
function sleep(time) {
2324
return new Promise((res, rej) => {

node_modules/.package-lock.json

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)