Skip to content

Commit ae09441

Browse files
remove build identifier and only allow name
1 parent 7b243b9 commit ae09441

5 files changed

Lines changed: 25 additions & 44 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ const maestroCommand = program
242242
'Device timezone (e.g., "America/New_York", "Europe/London").',
243243
)
244244
// Test metadata
245-
.option('--name <name>', 'Test name for identification in dashboard.')
246-
.option('--build <build>', 'Build identifier for grouping test runs.')
245+
.option('--name <name>', 'Name for this Maestro run.')
247246
// Network and geo
248247
.option(
249248
'--throttle-network <speed>',
@@ -356,7 +355,6 @@ const maestroCommand = program
356355
platformName: args.platform,
357356
version: args.deviceVersion,
358357
name: args.name,
359-
build: args.build,
360358
orientation: args.orientation,
361359
locale: args.deviceLocale,
362360
timeZone: args.timezone,

src/models/maestro_options.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export interface MaestroCapabilities {
1414
version?: string;
1515
deviceName: string;
1616
name?: string;
17-
build?: string;
1817
orientation?: Orientation;
1918
locale?: string;
2019
timeZone?: string;
@@ -39,7 +38,6 @@ export default class MaestroOptions {
3938
private _platformName?: 'Android' | 'iOS';
4039
private _version?: string;
4140
private _name?: string;
42-
private _build?: string;
4341
private _orientation?: Orientation;
4442
private _locale?: string;
4543
private _timeZone?: string;
@@ -67,7 +65,6 @@ export default class MaestroOptions {
6765
platformName?: 'Android' | 'iOS';
6866
version?: string;
6967
name?: string;
70-
build?: string;
7168
orientation?: Orientation;
7269
locale?: string;
7370
timeZone?: string;
@@ -94,7 +91,6 @@ export default class MaestroOptions {
9491
this._platformName = options?.platformName;
9592
this._version = options?.version;
9693
this._name = options?.name;
97-
this._build = options?.build;
9894
this._orientation = options?.orientation;
9995
this._locale = options?.locale;
10096
this._timeZone = options?.timeZone;
@@ -145,10 +141,6 @@ export default class MaestroOptions {
145141
return this._name;
146142
}
147143

148-
public get build(): string | undefined {
149-
return this._build;
150-
}
151-
152144
public get orientation(): Orientation | undefined {
153145
return this._orientation;
154146
}
@@ -258,7 +250,6 @@ export default class MaestroOptions {
258250

259251
if (this._version) caps.version = this._version;
260252
if (this._name) caps.name = this._name;
261-
if (this._build) caps.build = this._build;
262253
if (this._orientation) caps.orientation = this._orientation;
263254
if (this._locale) caps.locale = this._locale;
264255
if (this._timeZone) caps.timeZone = this._timeZone;

src/providers/maestro.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,13 +1499,13 @@ export default class Maestro {
14991499
}
15001500

15011501
private async generateArtifactZipName(outputDir: string): Promise<string> {
1502-
if (!this.options.build) {
1502+
if (!this.options.name) {
15031503
// Generate unique name with timestamp
15041504
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
15051505
return `maestro_artifacts_${timestamp}.zip`;
15061506
}
15071507

1508-
const baseName = this.options.build.replace(/[^a-zA-Z0-9_-]/g, '_');
1508+
const baseName = this.options.name.replace(/[^a-zA-Z0-9_-]/g, '_');
15091509
const fileName = `${baseName}.zip`;
15101510
const filePath = path.join(outputDir, fileName);
15111511

tests/models/maestro_options.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ describe('MaestroOptions', () => {
1111
expect(options.platformName).toBeUndefined();
1212
expect(options.version).toBeUndefined();
1313
expect(options.name).toBeUndefined();
14-
expect(options.build).toBeUndefined();
1514
expect(options.orientation).toBeUndefined();
1615
expect(options.locale).toBeUndefined();
1716
expect(options.timeZone).toBeUndefined();
@@ -30,7 +29,6 @@ describe('MaestroOptions', () => {
3029
platformName: 'Android',
3130
version: '14',
3231
name: 'Test Run',
33-
build: 'build-456',
3432
orientation: 'LANDSCAPE',
3533
locale: 'de_DE',
3634
timeZone: 'Europe/Berlin',
@@ -50,7 +48,6 @@ describe('MaestroOptions', () => {
5048
expect(options.platformName).toBe('Android');
5149
expect(options.version).toBe('14');
5250
expect(options.name).toBe('Test Run');
53-
expect(options.build).toBe('build-456');
5451
expect(options.orientation).toBe('LANDSCAPE');
5552
expect(options.locale).toBe('de_DE');
5653
expect(options.timeZone).toBe('Europe/Berlin');
@@ -181,7 +178,6 @@ describe('MaestroOptions', () => {
181178
platformName: 'iOS',
182179
version: '17.2',
183180
name: 'iOS Test',
184-
build: 'ios-build-1',
185181
orientation: 'PORTRAIT',
186182
locale: 'en_GB',
187183
timeZone: 'Europe/London',
@@ -195,7 +191,6 @@ describe('MaestroOptions', () => {
195191
platformName: 'iOS',
196192
version: '17.2',
197193
name: 'iOS Test',
198-
build: 'ios-build-1',
199194
orientation: 'PORTRAIT',
200195
locale: 'en_GB',
201196
timeZone: 'Europe/London',
@@ -218,7 +213,6 @@ describe('MaestroOptions', () => {
218213
version: '13',
219214
});
220215
expect(caps).not.toHaveProperty('name');
221-
expect(caps).not.toHaveProperty('build');
222216
expect(caps).not.toHaveProperty('orientation');
223217
expect(caps).not.toHaveProperty('locale');
224218
expect(caps).not.toHaveProperty('timeZone');

tests/providers/maestro.test.ts

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ describe('Maestro', () => {
314314
platformName: 'Android',
315315
version: '14',
316316
name: 'My Test',
317-
build: 'build-123',
318317
orientation: 'LANDSCAPE',
319318
locale: 'en_US',
320319
timeZone: 'America/New_York',
@@ -342,7 +341,6 @@ describe('Maestro', () => {
342341
platformName: 'Android',
343342
version: '14',
344343
name: 'My Test',
345-
build: 'build-123',
346344
orientation: 'LANDSCAPE',
347345
locale: 'en_US',
348346
timeZone: 'America/New_York',
@@ -1618,77 +1616,77 @@ describe('Maestro', () => {
16181616
await expect(maestroWithArtifacts['validate']()).resolves.toBe(true);
16191617
});
16201618

1621-
it('should generate zip filename from --build option', async () => {
1622-
const optionsWithBuild = new MaestroOptions(
1619+
it('should generate zip filename from --name option', async () => {
1620+
const optionsWithName = new MaestroOptions(
16231621
'path/to/app.apk',
16241622
'path/to/flows',
16251623
'Pixel 6',
16261624
{
16271625
downloadArtifacts: true,
1628-
build: 'my-build-123',
1626+
name: 'my-test-run',
16291627
},
16301628
);
1631-
const maestroWithBuild = new Maestro(mockCredentials, optionsWithBuild);
1629+
const maestroWithName = new Maestro(mockCredentials, optionsWithName);
16321630

16331631
// Mock access to throw (file doesn't exist)
16341632
(fs.promises.access as jest.Mock).mockRejectedValue(new Error('ENOENT'));
16351633

1636-
const zipName = await maestroWithBuild['generateArtifactZipName']('/tmp/test');
1637-
expect(zipName).toBe('my-build-123.zip');
1634+
const zipName = await maestroWithName['generateArtifactZipName']('/tmp/test');
1635+
expect(zipName).toBe('my-test-run.zip');
16381636
});
16391637

1640-
it('should sanitize build name for zip filename', async () => {
1641-
const optionsWithBuild = new MaestroOptions(
1638+
it('should sanitize name for zip filename', async () => {
1639+
const optionsWithName = new MaestroOptions(
16421640
'path/to/app.apk',
16431641
'path/to/flows',
16441642
'Pixel 6',
16451643
{
16461644
downloadArtifacts: true,
1647-
build: 'my build/test:v1.0',
1645+
name: 'my test/run:v1.0',
16481646
},
16491647
);
1650-
const maestroWithBuild = new Maestro(mockCredentials, optionsWithBuild);
1648+
const maestroWithName = new Maestro(mockCredentials, optionsWithName);
16511649

16521650
// Mock access to throw (file doesn't exist)
16531651
(fs.promises.access as jest.Mock).mockRejectedValue(new Error('ENOENT'));
16541652

1655-
const zipName = await maestroWithBuild['generateArtifactZipName']('/tmp/test');
1656-
expect(zipName).toBe('my_build_test_v1_0.zip');
1653+
const zipName = await maestroWithName['generateArtifactZipName']('/tmp/test');
1654+
expect(zipName).toBe('my_test_run_v1_0.zip');
16571655
});
16581656

1659-
it('should generate timestamp-based zip filename when no --build option', async () => {
1660-
const optionsWithoutBuild = new MaestroOptions(
1657+
it('should generate timestamp-based zip filename when no --name option', async () => {
1658+
const optionsWithoutName = new MaestroOptions(
16611659
'path/to/app.apk',
16621660
'path/to/flows',
16631661
'Pixel 6',
16641662
{ downloadArtifacts: true },
16651663
);
1666-
const maestroWithoutBuild = new Maestro(
1664+
const maestroWithoutName = new Maestro(
16671665
mockCredentials,
1668-
optionsWithoutBuild,
1666+
optionsWithoutName,
16691667
);
16701668

1671-
const zipName = await maestroWithoutBuild['generateArtifactZipName']('/tmp/test');
1669+
const zipName = await maestroWithoutName['generateArtifactZipName']('/tmp/test');
16721670
expect(zipName).toMatch(/^maestro_artifacts_\d{4}-\d{2}-\d{2}T.*\.zip$/);
16731671
});
16741672

16751673
it('should add timestamp suffix when zip file already exists', async () => {
1676-
const optionsWithBuild = new MaestroOptions(
1674+
const optionsWithName = new MaestroOptions(
16771675
'path/to/app.apk',
16781676
'path/to/flows',
16791677
'Pixel 6',
16801678
{
16811679
downloadArtifacts: true,
1682-
build: 'existing-build',
1680+
name: 'existing-name',
16831681
},
16841682
);
1685-
const maestroWithBuild = new Maestro(mockCredentials, optionsWithBuild);
1683+
const maestroWithName = new Maestro(mockCredentials, optionsWithName);
16861684

16871685
// Mock access: file exists
16881686
(fs.promises.access as jest.Mock).mockResolvedValueOnce(undefined);
16891687

1690-
const zipName = await maestroWithBuild['generateArtifactZipName']('/tmp/test');
1691-
expect(zipName).toMatch(/^existing-build_\d+\.zip$/);
1688+
const zipName = await maestroWithName['generateArtifactZipName']('/tmp/test');
1689+
expect(zipName).toMatch(/^existing-name_\d+\.zip$/);
16921690
});
16931691

16941692
it('should fetch run details with assets', async () => {

0 commit comments

Comments
 (0)