Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

Commit 5ed98c4

Browse files
feat: adjust output logs (#37)
* feat: adjust output logs * feat: add more detail output logs * fix: code format
1 parent 1e54363 commit 5ed98c4

5 files changed

Lines changed: 345 additions & 966 deletions

File tree

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@
77

88
### Inputs
99

10-
| option | required | default | description |
11-
| --------------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
12-
| api-token | true | | API token for Shiplight AI |
13-
| test-suite-id | true | | test suite ID (single ID or comma-separated list, e.g., "suite1" or "suite1,suite2,suite3") |
14-
| environment-id | true | | Environment ID |
15-
| environment-url | false | | Environment URL |
16-
| github-comment | false | `true` | If enabled, the action will comment on the pull request with the test run results |
17-
| github-token | false | `GITHUB_TOKEN` | Token used for leaving a comment on the pull request |
18-
| async | false | `false` | If enabled, will launch the tests but not wait for them to finish and the action will always output success. Note: GitHub comments will not function if this is set. |
10+
| option | required | default | description |
11+
| ---------------------- | -------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
12+
| api-token | true | | API token for Shiplight AI |
13+
| test-suite-id | true | | Test suite ID (single ID or comma-separated list, e.g., `1` or `1,2,3`) |
14+
| preflight-test-case-id | false | | Optional preflight test case ID. If set, the preflight test runs before the main test suites |
15+
| environment-id | true | | Environment ID |
16+
| environment-url | false | | Environment URL |
17+
| github-comment | false | `true` | If enabled, the action will comment on the pull request with the test run results |
18+
| github-token | false | `GITHUB_TOKEN` | Token used for leaving a comment on the pull request |
19+
| async | false | `false` | If enabled, launches the tests but does not wait for them to finish. The action will always output success. GitHub comments will not function if this is set |
20+
| commit-sha | false | | Commit SHA used to find the pull request for commenting |
21+
| timeout-seconds | false | `86400` | Maximum time to wait for test runs to complete, in seconds |
22+
| test-context | false | | Test context key-value pairs passed to the test run, one per line in `KEY=VALUE` format |
1923

2024
**Note**: The `test-suite-id` parameter supports both single test suite IDs for
2125
backward compatibility and comma-separated lists for running multiple test
@@ -24,10 +28,14 @@ simultaneously for improved efficiency.
2428

2529
### Outputs
2630

27-
| output | description |
28-
| ------- | -------------------------------------------------- |
29-
| success | Whether all test runs were successful |
30-
| results | JSON string containing results for each test suite |
31+
| output | description |
32+
| ---------------- | ----------------------------------------------------------- |
33+
| success | Whether all test runs were successful |
34+
| results | JSON string containing results for each test suite |
35+
| run-id | Shiplight run ID |
36+
| run-url | Shiplight run result URL |
37+
| preflight-result | Preflight result (`Passed`, `Failed`, `Skipped`, `Pending`) |
38+
| metadata | Trigger metadata JSON string |
3139

3240
### Example
3341

__tests__/main.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jest.unstable_mockModule('@actions/core', () => core)
1313

1414
// The module being tested should be imported dynamically. This ensures that the
1515
// mocks are used in place of any actual dependencies.
16-
const { run } = await import('../src/main.js')
16+
const { parseTestContextInput, run } = await import('../src/main.js')
1717

1818
describe('main.ts', () => {
1919
beforeEach(() => {
@@ -52,4 +52,17 @@ describe('main.ts', () => {
5252
'API token is required but was not provided'
5353
)
5454
})
55+
56+
it('Parses test-context lines and trims surrounding whitespace', () => {
57+
expect(parseTestContextInput(' foo = bar \nzip=zop=zap ')).toEqual({
58+
foo: 'bar',
59+
zip: 'zop=zap'
60+
})
61+
})
62+
63+
it('Rejects test-context lines with an empty key', () => {
64+
expect(() => parseTestContextInput(' =value ')).toThrow(
65+
'test-context key must not be empty, got: "=value"'
66+
)
67+
})
5568
})

0 commit comments

Comments
 (0)