play: old testing builds below production listed with their replace command (status, validate); 'Not live yet' instead of 'In review'; commit redone without changesNotSentForReview on the auto-send 400; pitfalls #129
This commit is contained in:
parent
83d351cf42
commit
9c001d1ca9
13 changed files with 130 additions and 15 deletions
31
tests/play-old-builds.test.ts
Normal file
31
tests/play-old-builds.test.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { describe, expect, test } from 'bun:test';
|
||||
import { oldBuildLines, oldTrackBuilds } from '../cli/play/old-builds';
|
||||
import { isAutoSendOnly, isReviewRefused } from '../cli/play/review-pending';
|
||||
|
||||
const tracks = [
|
||||
{ track: 'production', releases: [{ name: '2.0.0 (10)', versionCodes: ['10'], status: 'completed' }] },
|
||||
{ track: 'alpha', releases: [{ name: '1.0 (2)', versionCodes: ['2'], status: 'completed' }] },
|
||||
{ track: 'beta', releases: [{ versionCodes: ['10'], status: 'completed' }] },
|
||||
{ track: 'internal', releases: [{ versionCodes: ['3'], status: 'draft' }] },
|
||||
{ track: 'qa-closed', releases: [{ versionCodes: ['4'], status: 'completed' }] },
|
||||
];
|
||||
|
||||
describe('old builds on testing tracks (pitfall 129)', () => {
|
||||
test('active builds below production are listed with the command that replaces them; drafts and current ones are not', () => {
|
||||
const old = oldTrackBuilds(tracks);
|
||||
expect(old.map(o => `${o.track}:${o.versionCodes.join(',')}`)).toEqual(['alpha:2', 'qa-closed:4']);
|
||||
const text = oldBuildLines(old).join('\n');
|
||||
expect(text).toContain('storebound play release --version-code 10 --alpha completed');
|
||||
expect(text).toContain('--track qa-closed completed');
|
||||
});
|
||||
test('no production release: nothing to compare', () => {
|
||||
expect(oldTrackBuilds(tracks.filter(t => t.track !== 'production'))).toEqual([]);
|
||||
});
|
||||
test('the "are sent for review automatically" 400 is told apart from the "cannot be sent" one', () => {
|
||||
const auto = new Error('POST commit -> 400 {"error":{"message":"Changes are sent for review automatically.","errors":[{"reason":"badRequest"}]}}');
|
||||
const refused = new Error('POST commit -> 400 {"error":{"message":"Changes cannot be sent for review automatically.","errors":[{"reason":"badRequest"}]}}');
|
||||
expect(isAutoSendOnly(auto)).toBe(true);
|
||||
expect(isAutoSendOnly(refused)).toBe(false);
|
||||
expect(isReviewRefused(refused)).toBe(true);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue