diff --git a/README.md b/README.md index 5208423..d44dee6 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,14 @@ Official documentation for Testream automated test reporting. - .NET Reporter: https://docs.testream.app/reporters/dotnet - Cypress Reporter: https://docs.testream.app/reporters/cypress - Jest Reporter: https://docs.testream.app/reporters/jest +- Jasmine Reporter: https://docs.testream.app/reporters/jasmine - WebdriverIO Reporter: https://docs.testream.app/reporters/webdriverio - Mocha Reporter: https://docs.testream.app/reporters/mocha - CLI Reporter: https://docs.testream.app/reporters/cli - JUnit Reporter: https://docs.testream.app/reporters/junit - Pytest Reporter: https://docs.testream.app/reporters/pytest - Vitest Reporter: https://docs.testream.app/reporters/vitest +- Go Reporter: https://docs.testream.app/reporters/go - Jira Integration: https://docs.testream.app/jira-integration/overview (Marketplace: https://marketplace.atlassian.com/apps/3048460704) ## Packages diff --git a/docs/features/rovo-setup-agent.md b/docs/features/rovo-setup-agent.md index 4408ccd..689ec3c 100644 --- a/docs/features/rovo-setup-agent.md +++ b/docs/features/rovo-setup-agent.md @@ -31,7 +31,7 @@ Open **Apps → Testream → Settings → Get Started with Rovo** in Jira. Selec ![Testream setup dialog for choosing a framework and CI provider](/img/product/testream-rovo-setup-dialog.png) -The setup flow supports the Testream reporter paths for Playwright, Cypress, Jest, Vitest, WebdriverIO, Mocha, pytest, JUnit XML, .NET, and CLI-based CTRF uploads. +The setup flow supports the Testream reporter paths for Playwright, Cypress, Jest, Jasmine, Vitest, WebdriverIO, Mocha, Go, pytest, JUnit XML, .NET, and CLI-based CTRF uploads. ![Testream setup screen for selecting the test stack](/img/product/testream-rovo-setup-selection.png) diff --git a/docs/getting-started/ai-assisted-setup.md b/docs/getting-started/ai-assisted-setup.md index 3d684c7..f91cc1c 100644 --- a/docs/getting-started/ai-assisted-setup.md +++ b/docs/getting-started/ai-assisted-setup.md @@ -52,7 +52,7 @@ You do not need to paste a real API key into source code or chat. The setup agen In the launcher, choose: -- **Project/test framework** - for example Playwright, Cypress, Jest, Vitest, WebdriverIO, Mocha, pytest, JUnit XML, or .NET. +- **Project/test framework** - for example Playwright, Cypress, Jest, Jasmine, Vitest, WebdriverIO, Mocha, Go, pytest, JUnit XML, or .NET. - **CI provider** - for example GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure Pipelines, CircleCI, Jenkins, or **I'm not sure**. Testream maps those choices to the closest reporter, sample project, and setup template before opening Rovo. diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 7c3539a..941fcbe 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -56,12 +56,14 @@ If your Jira workspace has Rovo enabled, use the **Testream Setup Agent** to fin | Playwright | [Playwright Reporter](../reporters/playwright) | Browser test results and artifacts | | Cypress | [Cypress Reporter](../reporters/cypress) | End-to-end results and artifacts | | Jest | [Jest Reporter](../reporters/jest) | Unit and integration test evidence | +| Jasmine | [Jasmine Reporter](../reporters/jasmine) | JavaScript test results and source evidence | | Vitest | [Vitest Reporter](../reporters/vitest) | Fast frontend and service test runs | | Mocha | [Mocha Reporter](../reporters/mocha) | JavaScript test runs | | WebdriverIO | [WebdriverIO Reporter](../reporters/webdriverio) | WebdriverIO suite evidence | | Pytest | [Pytest Reporter](../reporters/pytest) | Python test results and metadata | | JUnit XML | [JUnit Reporter](../reporters/junit) | Existing JUnit XML reports | | .NET | [.NET Reporter](../reporters/dotnet) | .NET and TRX-based runs | +| Go | [Go Reporter](../reporters/go) | Go test results and source evidence | | Any CTRF output | [CLI Reporter](../reporters/cli) | Converted or custom test reports | ## 3. Publish Your First Run diff --git a/docs/intro.md b/docs/intro.md index d540ebb..135c02e 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -50,12 +50,14 @@ Testream supports the following reporters out of the box: - **.NET** - xUnit, NUnit, MSTest, and TRX formats - **Cypress** - E2E testing for web applications - **Jest** - Unit and integration testing for JavaScript/TypeScript +- **Jasmine** - Jasmine 5 testing with source evidence - **WebdriverIO** - E2E testing for web applications - **Mocha** - Flexible JavaScript test framework - **CLI** - Upload CTRF reports from any test tool - **JUnit** - Parse and upload JUnit XML test results - **Vitest** - Blazing-fast unit testing for Vite projects - **pytest** - Python testing framework with rich plugin ecosystem +- **Go** - Go test runs with CTRF and source snippets ### CTRF Standard diff --git a/docs/reporters/go.md b/docs/reporters/go.md new file mode 100644 index 0000000..f79c761 --- /dev/null +++ b/docs/reporters/go.md @@ -0,0 +1,178 @@ +--- +sidebar_position: 12 +title: 'Go Reporter' +description: 'Run Go tests from CI/CD and send CTRF results into Jira with the Testream Go Reporter, source evidence, CI metadata, and test-run history.' +keywords: + - go jira reporter + - golang test reporting jira + - go test reporter + - go ctrf reporter +--- + +# Go Reporter + +Use the Testream Go Reporter to run Go tests, generate CTRF results, and send source evidence and CI context into Testream and Jira. + +Looking for the higher-level product fit first? Read the website page for [CI/CD test results in Jira](https://testream.app/ci-test-results-jira). + +For CI context and pull-request comparison setup, see [CI context and pull-request comparisons](../features/ci-context). + +## Installation + +Use the package with `npx`: + +```bash +npx @testream/go-reporter --help +``` + +Or install the CLI globally: + +```bash +npm install -g @testream/go-reporter +``` + +The reporter requires a Go project and a `go` executable available in the environment. It uses the official Go CTRF reporter when a local `go-ctrf-json-reporter` executable is not available. + +## Quick Start + +Run the default Go test package selector and upload the generated report: + +```bash +npx @testream/go-reporter \ + --api-key "$TESTREAM_API_KEY" +``` + +The command runs `go test -json ./...`, converts the output to CTRF, adds source evidence when matching Go files are available, writes `ctrf/ctrf-report.json`, and uploads the completed run. + +## CLI Options + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `-k, --api-key ` | `string` | - | **Required** API key unless `--no-upload` is used. | +| `--project ` | `string` | current directory | Path to the Go project root. | +| `--go ` | `string` | `go` | Go executable to run. | +| `--go-reporter ` | `string` | auto-detected | Local `go-ctrf-json-reporter` executable. | +| `--go-packages ` | `string` | `./...` | Package selector passed to `go test`. | +| `--ctrf-path ` | `string` | - | Ingest existing CTRF JSON files without running Go tests. | +| `--output-dir ` | `string` | `ctrf` | Directory for the generated or merged CTRF report. | +| `--output-file ` | `string` | `ctrf-report.json` | CTRF report filename. | +| `--branch ` | `string` | auto from CI | Override the Git branch name. | +| `--commit-sha ` | `string` | auto from CI | Override the Git commit SHA. | +| `--repository-url ` | `string` | auto from CI | Override the repository URL. | +| `--build-name ` | `string` | optional | Build name or identifier. | +| `--build-number ` | `string` | auto from CI | Build number. | +| `--build-url ` | `string` | auto from CI | CI pipeline URL. | +| `--test-environment ` | `string` | optional | Environment such as `ci`, `staging`, or `production`. | +| `--app-name ` | `string` | optional | Application name under test. | +| `--app-version ` | `string` | optional | Application version under test. | +| `--test-type ` | `string` | optional | Test type such as `unit`, `integration`, or `e2e`. | +| `--no-upload` | `boolean` | `false` | Generate and validate the CTRF report without uploading it. | +| `--fail-on-error` | `boolean` | `false` | Exit with a non-zero code when the upload fails. | +| `-- ` | - | - | Additional arguments passed to `go test`. | + +Git and CI context are detected automatically when the command runs in a supported provider. Provide explicit values when the reporter runs outside CI or when you need to override detected metadata. + +## Examples + +### Run tests and upload + +```bash +npx @testream/go-reporter \ + --api-key "$TESTREAM_API_KEY" \ + --build-name "Go Tests" \ + --test-environment ci \ + --app-name "my-go-service" \ + --app-version 1.0.0 \ + --test-type unit \ + --fail-on-error +``` + +### Generate a local report without upload + +```bash +npx @testream/go-reporter \ + --no-upload \ + --output-dir artifacts \ + --output-file go-results.json +``` + +### Use an existing CTRF report + +```bash +npx @testream/go-reporter \ + --ctrf-path ./ctrf/ctrf-report.json \ + --no-upload +``` + +### Run a specific project or package selector + +```bash +npx @testream/go-reporter \ + --project ./services/api \ + --go-packages ./services/api/... +``` + +### Pass arguments to `go test` + +```bash +npx @testream/go-reporter \ + --api-key "$TESTREAM_API_KEY" \ + -- --run TestCriticalPath +``` + +## Source Evidence and Test Failures + +The Go Reporter enriches matching test results with Go source locations and bounded snippets inside the project root. The reporter uses the Go module path from `go.mod` when it matches test suites to source files. + +Go test failures remain Go test failures after the report is generated and uploaded. The reporter continues conversion and upload for a test exit code of `1`, then returns that original non-zero code. The `--fail-on-error` option controls upload failures; it does not turn a failed Go test run into a passing command. + +## GitHub Actions Example + +```yaml title=".github/workflows/go-tests.yml" +name: Go Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v5 + with: + go-version: "1.24" + + - uses: actions/setup-node@v4 + with: + node-version: 24 + + - run: npm install -g @testream/go-reporter + + - name: Run Go tests and upload results + env: + TESTREAM_API_KEY: ${{ secrets.TESTREAM_API_KEY }} + run: | + testream-go \ + --api-key "$TESTREAM_API_KEY" \ + --build-name "${{ github.workflow }}" \ + --test-environment ci \ + --app-name "${{ github.event.repository.name }}" \ + --app-version "${{ github.sha }}" \ + --test-type unit \ + --fail-on-error +``` + +## NPM Package + +- **Package:** [@testream/go-reporter](https://www.npmjs.com/package/@testream/go-reporter) +- **Organization:** [Testream packages](https://www.npmjs.com/org/testream) +- **Official converter:** [go-ctrf-json-reporter](https://github.com/ctrf-io/go-ctrf-json-reporter) + +## What's Next? + +- Learn about the [JUnit Reporter](./junit). +- Learn about the [CLI Reporter](./cli) for existing CTRF results from other tools. +- Review [CI context and pull-request comparisons](../features/ci-context). diff --git a/docs/reporters/jasmine.md b/docs/reporters/jasmine.md new file mode 100644 index 0000000..54790e0 --- /dev/null +++ b/docs/reporters/jasmine.md @@ -0,0 +1,155 @@ +--- +sidebar_position: 11 +title: 'Jasmine Reporter' +description: 'Send Jasmine 5 test results from Node.js CI/CD into Jira with the Testream Jasmine Reporter, source evidence, CTRF output, and run metadata.' +keywords: + - jasmine jira reporter + - jasmine test reporting jira + - jasmine ci results jira + - jasmine ctrf reporter +--- + +# Jasmine Reporter + +Use the Testream Jasmine Reporter to send Jasmine 5 test results from Node.js CI/CD into Testream and Jira with CTRF output, source evidence, and CI run metadata. + +Looking for the higher-level product fit first? Read the website page for [CI/CD test results in Jira](https://testream.app/ci-test-results-jira). + +For CI context and pull-request comparison setup, see [CI context and pull-request comparisons](../features/ci-context). + +## Installation + +```bash +npm install --save-dev @testream/jasmine-reporter +``` + +## Basic Configuration + +Register the reporter from a Jasmine helper loaded by your configuration, such as `helpers/testream-reporter.js`: + +```javascript title="helpers/testream-reporter.js" +const TestreamJasmineReporter = require("@testream/jasmine-reporter"); + +jasmine.getEnv().addReporter( + new TestreamJasmineReporter({ + apiKey: process.env.TESTREAM_API_KEY, + uploadEnabled: process.env.TESTREAM_UPLOAD_ENABLED === "true", + failOnUploadError: + process.env.TESTREAM_FAIL_ON_UPLOAD_ERROR === "true", + testEnvironment: process.env.TESTREAM_TEST_ENVIRONMENT || "ci", + appName: process.env.TESTREAM_APP_NAME || "my-app", + appVersion: process.env.TESTREAM_APP_VERSION || "1.0.0", + testType: process.env.TESTREAM_TEST_TYPE || "unit", + }), +); +``` + +Run Jasmine normally: + +```bash +npx jasmine +``` + +The reporter writes `ctrf/ctrf-report.json` by default. It uploads the report when upload is enabled and an API key is available. + +## Local Report Without Upload + +Generate a local CTRF report without making a network request: + +```javascript +new TestreamJasmineReporter({ + uploadEnabled: false, + outputDir: "artifacts", + outputFile: "jasmine-results.json", +}); +``` + +The reporter normalizes the report tool to `jasmine` and adds `generatedBy: "@testream/jasmine-reporter"`. + +## Configuration Options + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `apiKey` | `string` | empty | Testream API key. Upload is skipped when no key is available. | +| `uploadEnabled` | `boolean \| string` | `true` | Enable or disable automatic upload. | +| `failOnUploadError` | `boolean \| string` | `false` | Fail the Jasmine run when upload fails. | +| `outputDir` | `string` | `ctrf` | Directory for the CTRF report. | +| `outputFile` | `string` | `ctrf-report.json` | Report filename. A `.json` suffix is added when omitted. | +| `sourceRoot` | `string` | `process.cwd()` | Root used for source evidence discovery. | +| `discoverFiles` | `boolean` | `true` | Discover source files when Jasmine does not provide file locations. | +| `sourceFiles` | `string[]` | Jasmine-loaded files | Restrict discovery to files relative to `sourceRoot` or to absolute paths. Useful for ESM or programmatic setups. | +| `maxChars`, `maxLines` | `number` | shared defaults | Bound the source evidence stored in each test result. | +| `branch` | `string` | auto from CI | Override the Git branch name. | +| `commitSha` | `string` | auto from CI | Override the Git commit SHA. | +| `repositoryUrl` | `string` | auto from CI | Override the repository URL. | +| `buildName`, `buildNumber`, `buildUrl` | `string` | optional/CI | Add build metadata or override detected CI values. | +| `testEnvironment` | `string` | optional | Environment such as `ci`, `staging`, or `local`. | +| `appName`, `appVersion`, `testType` | `string` | optional | Application and test metadata. | + +When branch, commit, repository, build, or merge-base values are not supplied, Testream resolves supported CI context during upload. See the [CI context guide](../features/ci-context) for checkout requirements and supported providers. + +## Source Evidence + +Testream adds source evidence to Jasmine results by matching test names to JavaScript or TypeScript files and recording the matched file path, line, and bounded snippet. For ESM or programmatic runners, set `sourceFiles` and `sourceRoot` as needed; set `discoverFiles: false` to disable scanning. + +## Upload Failures and Test Exit Status + +Uploads are best-effort by default. Set `failOnUploadError: true` when a failed upload must fail the Jasmine process: + +```javascript +new TestreamJasmineReporter({ + apiKey: process.env.TESTREAM_API_KEY, + failOnUploadError: true, +}); +``` + +Jasmine test failures remain the test command's exit signal. The upload-failure option adds upload status to that signal; it does not replace Jasmine's test result handling. + +## Artifacts + +Jasmine's standard reporter lifecycle does not provide framework-owned screenshots or videos. This package reports tests, source evidence, and CTRF metadata; artifact capture requires a separate CI or test integration. + +## GitHub Actions Example + +```yaml title=".github/workflows/jasmine-tests.yml" +name: Jasmine Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 24 + + - run: npm ci + + - name: Run Jasmine tests + env: + TESTREAM_API_KEY: ${{ secrets.TESTREAM_API_KEY }} + TESTREAM_UPLOAD_ENABLED: "true" + TESTREAM_FAIL_ON_UPLOAD_ERROR: "true" + TESTREAM_BUILD_NAME: ${{ github.workflow }} + TESTREAM_TEST_ENVIRONMENT: ci + TESTREAM_APP_NAME: ${{ github.event.repository.name }} + TESTREAM_APP_VERSION: ${{ github.sha }} + TESTREAM_TEST_TYPE: unit + run: npm test +``` + +## NPM Package + +- **Package:** [@testream/jasmine-reporter](https://www.npmjs.com/package/@testream/jasmine-reporter) +- **Organization:** [Testream packages](https://www.npmjs.com/org/testream) + +## What's Next? + +- Learn about the [Jest Reporter](./jest). +- Learn about the [Vitest Reporter](./vitest). +- Review [CI context and pull-request comparisons](../features/ci-context). diff --git a/sidebars.ts b/sidebars.ts index 5235491..deff650 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -28,6 +28,8 @@ const sidebars: SidebarsConfig = { 'reporters/junit', 'reporters/pytest', 'reporters/vitest', + 'reporters/go', + 'reporters/jasmine', ], }, { diff --git a/src/pages/index.module.css b/src/pages/index.module.css index feca800..28e28fa 100644 --- a/src/pages/index.module.css +++ b/src/pages/index.module.css @@ -47,10 +47,8 @@ .capabilityCard { min-height: 245px; padding: 1.6rem; background: var(--ifm-background-surface-color); border: 1px solid var(--testream-border); border-radius: 0.85rem; } .capabilityCard h3 { margin: 0; color: var(--testream-text-primary); font-size: 1.5rem; letter-spacing: -0.035em; } .capabilityCard > p:not(.cardEyebrow) { color: var(--testream-text-secondary); line-height: 1.6; } -.capabilityCard a, -.textLink { color: var(--ifm-color-primary-dark); font-weight: 650; text-decoration: none; } -.capabilityCard a:hover, -.textLink:hover { text-decoration: underline; } +.capabilityCard a { color: var(--ifm-color-primary-dark); font-weight: 650; text-decoration: none; } +.capabilityCard a:hover { text-decoration: underline; } .reporterGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; } .reporterCard { padding: 1rem; background: var(--ifm-background-surface-color); border: 1px solid var(--testream-border); border-radius: 0.7rem; } @@ -63,8 +61,6 @@ .copyButton:hover { color: var(--testream-text-primary); border-color: var(--ifm-color-primary-light); } .copyButton code { overflow: hidden; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; } .copyButton span { flex: 0 0 auto; color: var(--ifm-color-primary); font-size: 0.72rem; font-weight: 650; } -.textLink { display: block; max-width: 1180px; margin: 1.5rem auto 0; } - .finalCta { color: var(--testream-home-final-text); background: var(--testream-home-final-bg); text-align: center; } .finalCta .eyebrow { color: #74d9cf; } .finalCta h2 { max-width: 720px; margin: 0 auto; color: var(--testream-home-final-heading); font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -0.055em; line-height: 1.05; } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 9546686..a12b350 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -17,6 +17,9 @@ const reporters = [ {name: 'WebdriverIO', packageName: '@testream/webdriverio-reporter', link: '/reporters/webdriverio', icon: 'https://ctrf.io/img/wdio.svg'}, {name: 'Mocha', packageName: '@testream/mocha-reporter', link: '/reporters/mocha', icon: 'https://ctrf.io/img/mochajs.svg'}, {name: 'Pytest', packageName: '@testream/pytest-reporter', link: '/reporters/pytest', icon: 'https://ctrf.io/img/pytest.svg'}, + {name: 'Go', packageName: '@testream/go-reporter', link: '/reporters/go', icon: 'https://ctrf.io/img/go.svg'}, + {name: 'Jasmine', packageName: '@testream/jasmine-reporter', link: '/reporters/jasmine', icon: 'https://ctrf.io/img/jasmine.svg'}, + {name: 'CLI', packageName: '@testream/cli', link: '/reporters/cli', icon: '/img/command-line-icon.png'}, ] as const; const capabilities = [ @@ -164,7 +167,6 @@ function ReporterSection() { ))} - Need another tool? Upload with the CLI reporter → ); } @@ -206,9 +208,9 @@ export default function Home() {
+ -
diff --git a/static/llms.txt b/static/llms.txt index 3eb9ce6..309e8b6 100644 --- a/static/llms.txt +++ b/static/llms.txt @@ -34,6 +34,8 @@ - [Mocha Reporter](https://docs.testream.app/reporters/mocha): Configure Mocha reporter options and CI/CD uploads. - [Pytest Reporter](https://docs.testream.app/reporters/pytest): Configure Pytest reporting and JUnit-ingestion workflows. - [Vitest Reporter](https://docs.testream.app/reporters/vitest): Configure Vitest reporting and CI/CD uploads. +- [Go Reporter](https://docs.testream.app/reporters/go): Run Go tests, generate CTRF results, and upload source evidence and CI context. +- [Jasmine Reporter](https://docs.testream.app/reporters/jasmine): Configure Jasmine 5 reporting, source evidence, CTRF output, and CI metadata. - [CLI Reporter](https://docs.testream.app/reporters/cli): Upload CTRF results from any CI provider. ## Sample repositories