Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/providers/maestro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,14 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
this.updateKey = result.update_key;
}

// The server registers a GitHub check when the run carries repo + commit
// metadata and the TestingBot GitHub App is installed for that repo.
if (result.ci_check?.repo && !this.options.quiet) {
logger.info(
`GitHub check registered for ${result.ci_check.repo}@${String(result.ci_check.commit_sha).slice(0, 7)}; the PR status updates when the run completes.`,
);
}

if (result.success === false) {
// API returns errors as an array
const errorMessage =
Expand Down
22 changes: 22 additions & 0 deletions tests/providers/maestro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,28 @@ describe('Maestro', () => {
);
});

it('logs when the server registered a GitHub check for the run', async () => {
maestro['appId'] = 1234;
axios.post = jest.fn().mockResolvedValueOnce({
data: {
success: true,
runs: [],
ci_check: {
provider: 'github',
repo: 'acme/app',
commit_sha: 'abcdef0123456789',
},
},
headers: {},
});
const logSpy = jest.spyOn(logger, 'info').mockImplementation(() => {});
await maestro['runTests']();
expect(logSpy).toHaveBeenCalledWith(
expect.stringContaining('GitHub check registered for acme/app@abcdef0'),
);
logSpy.mockRestore();
});

it('should not include maestroOptions when none are set', async () => {
maestro['appId'] = 1234;

Expand Down
Loading