Skip to content
Closed
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
35 changes: 1 addition & 34 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,7 @@ export default defineConfig({
}),
astroAsides(),
astroYoutubeEmbeds(),
astroExpressiveCode({
themes: ['slack-ochin', 'slack-dark'],
themeCssSelector: (theme) => {
if (theme.name === 'slack-ochin') return ':root:not(.theme-dark)';
if (theme.name === 'slack-dark') return ':root.theme-dark';
return `[data-theme='${theme.name}']`;
},
styleOverrides: {
borderColor: 'var(--theme-border)',
borderRadius: '0.5rem',
borderWidth: '1px',
codePaddingBlock: '1rem',
codePaddingInline: '1.25rem',
codeFontFamily: 'var(--font-mono)',
codeFontSize: '0.85rem',
codeLineHeight: '1.7',
uiFontFamily: 'var(--font-body)',
uiFontSize: '0.8rem',
focusBorder: 'var(--theme-link)',
frames: {
frameBoxShadowCssValue: 'none',
editorTabBarBorderBottomColor: 'var(--theme-divider)',
editorActiveTabIndicatorBottomColor: 'var(--theme-link)',
editorActiveTabIndicatorTopColor: 'transparent',
terminalTitlebarBorderBottomColor: 'var(--theme-divider)',
tooltipSuccessBackground: 'var(--theme-link)',
tooltipSuccessForeground: '#fff',
inlineButtonBorder: 'var(--theme-divider)',
inlineButtonForeground: 'var(--theme-text-muted)',
inlineButtonBackgroundIdleOpacity: '0',
inlineButtonBackgroundHoverOrFocusOpacity: '0.08',
},
},
}),
astroExpressiveCode(),
mdx(),
react(),
vue(),
Expand Down
41 changes: 41 additions & 0 deletions ec.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineEcConfig } from 'astro-expressive-code';

export default defineEcConfig({
themes: ['github-light', 'github-dark'],
themeCssSelector: (theme) => {
if (theme.name === 'github-light') return ':root:not(.theme-dark)';
if (theme.name === 'github-dark') return ':root.theme-dark';
return `[data-theme='${theme.name}']`;
},
styleOverrides: {
borderColor: 'var(--theme-border)',
borderRadius: '0.5rem',
borderWidth: '1px',
codePaddingBlock: '1rem',
codePaddingInline: '1.25rem',
codeFontFamily: 'var(--font-mono)',
codeFontSize: '0.85rem',
codeLineHeight: '1.7',
uiFontFamily: 'var(--font-body)',
uiFontSize: '0.8rem',
focusBorder: 'var(--theme-link)',
frames: {
frameBoxShadowCssValue: 'none',
editorTabBarBorderBottomColor: 'var(--theme-divider)',
editorActiveTabIndicatorBottomColor: 'var(--theme-link)',
editorActiveTabIndicatorTopColor: 'transparent',
editorTabBarBackground: 'var(--theme-bg-offset)',
editorActiveTabBackground: 'var(--theme-bg-content)',
terminalTitlebarBackground: 'var(--theme-bg-offset)',
terminalTitlebarBorderBottomColor: 'var(--theme-divider)',
terminalTitlebarForeground: 'var(--theme-text-muted)',
terminalTitlebarDotsForeground: 'transparent',
tooltipSuccessBackground: 'var(--theme-text)',
tooltipSuccessForeground: 'var(--theme-bg-content)',
inlineButtonBorder: 'var(--theme-divider)',
inlineButtonForeground: 'var(--theme-text-muted)',
inlineButtonBackgroundIdleOpacity: '0',
inlineButtonBackgroundHoverOrFocusOpacity: '0.08',
},
},
});
3 changes: 3 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@
/integrations/teamcity/ /integrations/ci-status-checks 301
/integrations/gitlab /integrations/ci-status-checks 301
/integrations/gitlab/ /integrations/ci-status-checks 301
/ci-insights/test-frameworks/* /test-insights/test-frameworks/:splat 301
/ci-insights/quarantine /test-insights/quarantine 301
/ci-insights/quarantine/ /test-insights/quarantine 301

8 changes: 5 additions & 3 deletions src/components/BuildkiteCIUploadStep.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
import { Code } from 'astro:components';
import { Code as InlineCode } from 'astro:components';
import { Code } from 'astro-expressive-code/components';

const inlineThemes = { light: 'github-light', dark: 'github-dark' } as const;

export interface Props {
reportPath: string;
Expand All @@ -17,15 +20,14 @@ const { reportPath } = Astro.props;
report_path: ${reportPath}
token: "\${MERGIFY_TOKEN}"`}
lang="yaml"
theme="slack-ochin"
/>
<p>Key Points:</p>
<ul>
<li>
The plugin runs in the <code>post-command</code> hook, so it uploads results <strong>after</strong> your tests finish, even if they fail.
</li>
<li>
<Code code={`report_path: ${reportPath}`} inline lang="yaml" theme="slack-ochin" />: Points to
<InlineCode code={`report_path: ${reportPath}`} inline lang="yaml" themes={inlineThemes} />: Points to
where your JUnit file is located. Make sure it matches the path you set in your test configuration.
</li>
<li>
Expand Down
3 changes: 1 addition & 2 deletions src/components/BuildkiteCIUploadStepMatrix.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { Code } from 'astro:components';
import { Code } from 'astro-expressive-code/components';

import Aside from '~/components/Aside.astro';

Expand Down Expand Up @@ -28,7 +28,6 @@ const { reportPath } = Astro.props;
report_path: ${reportPath}
token: "\${MERGIFY_TOKEN}"`}
lang="yaml"
theme="slack-ochin"
/>
<Aside type="tip">
<p>
Expand Down
18 changes: 10 additions & 8 deletions src/components/MergifyCIUploadStep.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
import { Code } from 'astro:components';
import { Code as InlineCode } from 'astro:components';
import { Code } from 'astro-expressive-code/components';

const inlineThemes = { light: 'github-light', dark: 'github-dark' } as const;

export interface Props {
reportPath: string;
Expand All @@ -16,23 +19,22 @@ const { reportPath } = Astro.props;
report_path: ${reportPath}
test_step_outcome: \${{ steps.tests.outcome }}`}
lang="yaml"
theme="slack-ochin"
/>
<p>Key Points:</p>
<ul>
<li>
<Code code={`if: success() || failure()`} inline lang="yaml" theme="slack-ochin" />: Runs the
<InlineCode code={`if: success() || failure()`} inline lang="yaml" themes={inlineThemes} />: Runs the
upload step even if tests fail, ensuring <strong>CI Insights</strong> has the full report.
</li>
<li>
<Code code={`report_path: ${reportPath}`} inline lang="yaml" theme="slack-ochin" />: Points to
<InlineCode code={`report_path: ${reportPath}`} inline lang="yaml" themes={inlineThemes} />: Points to
where your JUnit file is located. Make sure it matches the path you set in your CI job.
</li>
<li>
<Code code={`test_step_outcome: \${{ steps.tests.outcome }}`} inline lang="yaml" theme="slack-ochin" />:
<InlineCode code={`test_step_outcome: \${{ steps.tests.outcome }}`} inline lang="yaml" themes={inlineThemes} />:
Passes the test runner step's outcome so Mergify can detect silent failures where the runner
crashed but the JUnit report appears clean. Add an <Code code="id" inline lang="yaml" theme="slack-ochin" /> (such
as <Code code="tests" inline lang="yaml" theme="slack-ochin" />) to your test runner step and
update the <Code code="steps.<id>.outcome" inline lang="yaml" theme="slack-ochin" /> reference to match.
crashed but the JUnit report appears clean. Add an <InlineCode code="id" inline lang="yaml" themes={inlineThemes} /> (such
as <InlineCode code="tests" inline lang="yaml" themes={inlineThemes} />) to your test runner step and
update the <InlineCode code="steps.<id>.outcome" inline lang="yaml" themes={inlineThemes} /> reference to match.
</li>
</ul>
4 changes: 1 addition & 3 deletions src/components/MergifyCIUploadStepMatrix.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { Code } from 'astro:components';
import { Code } from 'astro-expressive-code/components';

import Aside from '~/components/Aside.astro';

Expand All @@ -23,7 +23,6 @@ const { reportPath } = Astro.props;
matrix:
version: [10, 12, 14]`}
lang="yaml"
theme="slack-ochin"
/>
<p>Your upload step should look like:</p>
<Code
Expand All @@ -36,7 +35,6 @@ const { reportPath } = Astro.props;
report_path: ${reportPath}
test_step_outcome: \${{ steps.tests.outcome }}`}
lang="yaml"
theme="slack-ochin"
/>
<Aside type="tip">
<p>
Expand Down
16 changes: 9 additions & 7 deletions src/components/MergifyCliUploadStep.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
import { Code } from 'astro:components';
import { Code as InlineCode } from 'astro:components';
import { Code } from 'astro-expressive-code/components';

const inlineThemes = { light: 'github-light', dark: 'github-dark' } as const;

export interface Props {
reportPath: string;
Expand All @@ -11,8 +14,8 @@ const { reportPath, testCommand = '<your test command>' } = Astro.props;

<p>
Install the <a href="/cli">Mergify CLI</a> in your pipeline and export
<Code code={`MERGIFY_TOKEN`} inline lang="bash" theme="slack-ochin" />. Run
<Code code={`mergify ci junit-process`} inline lang="bash" theme="slack-ochin" /> after your tests:
<InlineCode code="MERGIFY_TOKEN" inline lang="bash" themes={inlineThemes} />. Run
<InlineCode code="mergify ci junit-process" inline lang="bash" themes={inlineThemes} /> after your tests:
</p>

<Code
Expand All @@ -24,22 +27,21 @@ mergify ci junit-process \\
${reportPath}
exit $exit_code`}
lang="bash"
theme="slack-ochin"
/>

<p>Key Points:</p>
<ul>
<li>
<Code code={`MERGIFY_TOKEN`} inline lang="bash" theme="slack-ochin" />: Export this
<InlineCode code="MERGIFY_TOKEN" inline lang="bash" themes={inlineThemes} />: Export this
environment variable with your Mergify application key so <code>junit-process</code> can authenticate to the API.
</li>
<li>
<Code code={`--test-exit-code "$exit_code"`} inline lang="bash" theme="slack-ochin" />: Passes the test runner's exit
<InlineCode code={`--test-exit-code "$exit_code"`} inline lang="bash" themes={inlineThemes} />: Passes the test runner's exit
code so Mergify can detect silent failures where the runner crashed but the JUnit report appears clean.
</li>
<li>
On CI systems other than GitHub Actions, also pass
<Code code={`--tests-target-branch <branch>`} inline lang="bash" theme="slack-ochin" /> so the command knows which
<InlineCode code="--tests-target-branch <branch>" inline lang="bash" themes={inlineThemes} /> so the command knows which
branch to compare against for quarantine decisions.
</li>
</ul>
116 changes: 4 additions & 112 deletions src/content/docs/ci-insights.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,115 +86,7 @@ Select your CI system below to enable CI Insights and configure flaky test detec

## Test Framework Configuration

CI Insights supports many test frameworks and captures test-level data from them.
Each framework requires a quick setup to ensure test results are parsed and uploaded properly.

Refer to the dedicated page for your specific framework to configure and verify your test output.

<DocsetGrid>
<Docset
title="Cypress"
path="/ci-insights/test-frameworks/cypress"
icon="simple-icons:cypress"
>
Integrate Cypress with CI Insights.
</Docset>
<Docset
title="Go"
path="/ci-insights/test-frameworks/golang"
icon="simple-icons:go"
>
Integrate Go with CI Insights.
</Docset>
<Docset
title="Jest"
path="/ci-insights/test-frameworks/jest"
icon="simple-icons:jest"
>
Integrate Jest with CI Insights.
</Docset>
<Docset
title="JUnit"
path="/ci-insights/test-frameworks/junit"
icon="simple-icons:junit5"
>
Integrate JUnit with CI Insights.
</Docset>
<Docset
title="Minitest"
path="/ci-insights/test-frameworks/minitest"
icon="simple-icons:ruby"
>
Integrate Minitest with CI Insights.
</Docset>
<Docset
title="MSTest"
path="/ci-insights/test-frameworks/mstest"
icon="simple-icons:dotnet"
>
Integrate MSTest with CI Insights.
</Docset>
<Docset
title="NUnit"
path="/ci-insights/test-frameworks/nunit"
icon="simple-icons:dotnet"
>
Integrate NUnit with CI Insights.
</Docset>
<Docset
title="Pest"
path="/ci-insights/test-frameworks/pest"
icon="simple-icons:php"
>
Integrate Pest with CI Insights.
</Docset>
<Docset
title="PHPUnit"
path="/ci-insights/test-frameworks/phpunit"
icon="simple-icons:php"
>
Integrate PHPUnit with CI Insights.
</Docset>
<Docset
title="Playwright"
path="/ci-insights/test-frameworks/playwright"
icon="simple-icons:playwright"
>
Integrate Playwright with CI Insights.
</Docset>
<Docset
title="Pytest"
path="/ci-insights/test-frameworks/pytest"
icon="simple-icons:pytest"
>
Integrate Pytest with CI Insights.
</Docset>
<Docset
title="RSpec"
path="/ci-insights/test-frameworks/rspec"
icon="simple-icons:ruby"
>
Integrate RSpec with CI Insights.
</Docset>
<Docset
title="Rust"
path="/ci-insights/test-frameworks/rust"
icon="simple-icons:rust"
>
Integrate Rust with CI Insights.
</Docset>
<Docset
title="TestNG"
path="/ci-insights/test-frameworks/testng"
icon="simple-icons:testinglibrary"
>
Integrate TestNG with CI Insights.
</Docset>
<Docset
title="Vitest"
path="/ci-insights/test-frameworks/vitest"
icon="simple-icons:vitest"
>
Integrate Vitest with CI Insights.
</Docset>
</DocsetGrid>
To capture test-level data from your CI pipeline, configure your test
framework to upload results to Mergify. See the
[Test Insights test framework guides](/test-insights#test-framework-configuration)
for framework-specific setup instructions.
4 changes: 2 additions & 2 deletions src/content/docs/ci-insights/setup/buildkite.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ every 12 hours on weekdays.

## Test Framework Configuration

See the [test framework guides](/ci-insights#test-framework-configuration) for
See the [test framework guides](/test-insights#test-framework-configuration) for
framework-specific instructions on generating JUnit XML reports and uploading
them to CI Insights with both GitHub Actions and Buildkite.
them with both GitHub Actions and Buildkite.
Loading