Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@

### Inputs

| option | required | default | description |
| --------------- | -------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| api-token | true | | API token for Shiplight AI |
| test-suite-id | true | | test suite ID (single ID or comma-separated list, e.g., "suite1" or "suite1,suite2,suite3") |
| environment-id | true | | Environment ID |
| environment-url | false | | Environment URL |
| github-comment | false | `true` | If enabled, the action will comment on the pull request with the test run results |
| github-token | false | `GITHUB_TOKEN` | Token used for leaving a comment on the pull request |
| 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. |
| option | required | default | description |
| ---------------------- | -------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| api-token | true | | API token for Shiplight AI |
| test-suite-id | true | | Test suite ID (single ID or comma-separated list, e.g., `1` or `1,2,3`) |
| preflight-test-case-id | false | | Optional preflight test case ID. If set, the preflight test runs before the main test suites |
| environment-id | true | | Environment ID |
| environment-url | false | | Environment URL |
| github-comment | false | `true` | If enabled, the action will comment on the pull request with the test run results |
| github-token | false | `GITHUB_TOKEN` | Token used for leaving a comment on the pull request |
| 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 |
| commit-sha | false | | Commit SHA used to find the pull request for commenting |
| timeout-seconds | false | `86400` | Maximum time to wait for test runs to complete, in seconds |
| test-context | false | | Test context key-value pairs passed to the test run, one per line in `KEY=VALUE` format |

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

### Outputs

| output | description |
| ------- | -------------------------------------------------- |
| success | Whether all test runs were successful |
| results | JSON string containing results for each test suite |
| output | description |
| ---------------- | ----------------------------------------------------------- |
| success | Whether all test runs were successful |
| results | JSON string containing results for each test suite |
| run-id | Shiplight run ID |
| run-url | Shiplight run result URL |
| preflight-result | Preflight result (`Passed`, `Failed`, `Skipped`, `Pending`) |
| metadata | Trigger metadata JSON string |

### Example

Expand Down
15 changes: 14 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jest.unstable_mockModule('@actions/core', () => core)

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

describe('main.ts', () => {
beforeEach(() => {
Expand Down Expand Up @@ -52,4 +52,17 @@ describe('main.ts', () => {
'API token is required but was not provided'
)
})

it('Parses test-context lines and trims surrounding whitespace', () => {
expect(parseTestContextInput(' foo = bar \nzip=zop=zap ')).toEqual({
foo: 'bar',
zip: 'zop=zap'
})
})

it('Rejects test-context lines with an empty key', () => {
expect(() => parseTestContextInput(' =value ')).toThrow(
'test-context key must not be empty, got: "=value"'
)
})
})
Loading
Loading