mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-30 11:53:55 +01:00
The stable release no longer skips a tested commit because a report-only workflow failed (#4865)
The daily stable release now ignores failures from workflows that are
documented as never blocking, starting with the weekly mutation report
that held back v1.104.2.0, and the mutation report runs again.
Why: stable releases should ship every fully tested commit, and today's
cut of 778934c0 was refused only because a report-only check failed on
it. Nothing to do after merge; the next daily run can cut v1.104.2.0.
Issue: GST-4095
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/outside-voice#3 reader=outside-voice
This commit is contained in:
1 parent
b022764a36
commit
260a5054c3
9 files changed
+126
-11
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
import * as fs from 'node:fs';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { bunIsolationArgs } from '../lib/bun-isolation';
|
||||
import { CONTROL_LINE, CONTROL_MESSAGE, STRYKER_PACKAGES, plantControl, rankChurn, renderMarkdown, summarize, type Mutant } from '../scripts/mutation-report';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dir, '..');
|
||||
@@ -48,6 +50,41 @@ describe('mutation-report', () => {
|
||||
expect(r.stderr).toContain('--throwaway-checkout');
|
||||
});
|
||||
|
||||
test('refuses a checkout with an edited tracked file and names it; untracked files are not edits', () => {
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'mutation-dirty-'));
|
||||
const repo = path.join(root, 'repo');
|
||||
fs.mkdirSync(repo);
|
||||
try {
|
||||
const git = (...args: string[]) => spawnSync('git', args, { cwd: repo, encoding: 'utf-8', timeout: 30_000 });
|
||||
fs.mkdirSync(path.join(repo, 'lib'));
|
||||
fs.writeFileSync(path.join(repo, 'lib/a.ts'), 'export const a = 1;\n');
|
||||
expect(git('init', '-q').status).toBe(0);
|
||||
expect(git('add', '.').status).toBe(0);
|
||||
expect(git('-c', 'user.name=t', '-c', 'user.email=t@example.com', '-c', 'commit.gpgsign=false', 'commit', '-qm', 'seed').status).toBe(0);
|
||||
const run = () => spawnSync(process.execPath, [...bunIsolationArgs(), path.join(ROOT, 'scripts/mutation-report.ts'), '--throwaway-checkout', '--stryker-dir', path.join(root, 'stryker'), '--out-dir', path.join(root, 'out'), '--since-days', '1', '--only', 'lib/none.ts'], { cwd: repo, encoding: 'utf-8', timeout: 30_000 });
|
||||
fs.writeFileSync(path.join(repo, 'build-output.html'), 'generated\n');
|
||||
const untracked = run();
|
||||
expect(untracked.status).toBe(1);
|
||||
expect(untracked.stderr).not.toContain('uncommitted changes');
|
||||
fs.writeFileSync(path.join(repo, 'lib/a.ts'), 'export const a = 2;\n');
|
||||
const edited = run();
|
||||
expect(edited.status).toBe(1);
|
||||
expect(edited.stderr).toContain('the checkout has uncommitted changes (lib/a.ts); use a clean disposable checkout');
|
||||
} finally {
|
||||
fs.rmSync(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test('the workflow restores tracked files the free-suite setup rebuilt before the report checks for a clean tree', () => {
|
||||
const wf = fs.readFileSync(path.join(ROOT, '.github/workflows/mutation-report.yml'), 'utf-8');
|
||||
const setup = wf.indexOf('bash scripts/ubicloud/setup-free-suite.sh');
|
||||
const restore = wf.indexOf('git checkout -- .');
|
||||
const report = wf.indexOf('scripts/mutation-report.ts \\');
|
||||
expect(setup).toBeGreaterThan(-1);
|
||||
expect(restore).toBeGreaterThan(setup);
|
||||
expect(report).toBeGreaterThan(restore);
|
||||
});
|
||||
|
||||
test('the workflow is scheduled, read-only and never runs on pull requests', () => {
|
||||
const wf = fs.readFileSync(path.join(ROOT, '.github/workflows/mutation-report.yml'), 'utf-8');
|
||||
expect(wf).toMatch(/^on:\n schedule:\n/m);
|
||||
|
||||
Reference in new issue
Block a user