Skip to content

Commit a13a8ca

Browse files
committed
add failure messages
1 parent e5904ab commit a13a8ca

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,13 +2360,15 @@ async function run() {
23602360
core.info(`licensed (${installedVersion}) gem installed`);
23612361
return;
23622362
}
2363+
core.info('gem installation was not successful');
23632364

23642365
core.info(`attempting to install licensed executable matching "${version}"`);
23652366
installedVersion = await installers.exe(version);
23662367
if (installedVersion) {
23672368
core.info(`licensed (${installedVersion}) executable installed`);
23682369
return;
23692370
}
2371+
core.info('exe installation was not successful');
23702372

23712373
throw new Error(`unable to install licensed matching "${version}"`);
23722374
} catch (error) {

lib/setup-licensed.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ async function run() {
1212
core.info(`licensed (${installedVersion}) gem installed`);
1313
return;
1414
}
15+
core.info('gem installation was not successful');
1516

1617
core.info(`attempting to install licensed executable matching "${version}"`);
1718
installedVersion = await installers.exe(version);
1819
if (installedVersion) {
1920
core.info(`licensed (${installedVersion}) executable installed`);
2021
return;
2122
}
23+
core.info('exe installation was not successful');
2224

2325
throw new Error(`unable to install licensed matching "${version}"`);
2426
} catch (error) {

tests/setup-licensed.test.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ describe('setup-licensed', () => {
5656
await run();
5757
expect(core.setFailed.callCount).toEqual(0);
5858

59-
expect(core.info.callCount).toEqual(3);
59+
expect(core.info.callCount).toEqual(4);
6060
expect(core.info.getCall(0).args).toEqual([`attempting to install licensed gem matching "${version}"`]);
61-
expect(core.info.getCall(1).args).toEqual([`attempting to install licensed executable matching "${version}"`]);
62-
expect(core.info.getCall(2).args).toEqual([`licensed (${version}) executable installed`]);
61+
expect(core.info.getCall(1).args).toEqual(['gem installation was not successful']);
62+
expect(core.info.getCall(2).args).toEqual([`attempting to install licensed executable matching "${version}"`]);
63+
expect(core.info.getCall(3).args).toEqual([`licensed (${version}) executable installed`]);
6364

6465
expect(installers.gem.callCount).toEqual(1);
6566

@@ -82,8 +83,10 @@ describe('setup-licensed', () => {
8283
await run();
8384
expect(core.setFailed.callCount).toEqual(1);
8485
expect(core.setFailed.getCall(0).args).toEqual([`unable to install licensed matching "${version}"`]);
85-
expect(core.info.callCount).toEqual(2);
86+
expect(core.info.callCount).toEqual(4);
8687
expect(core.info.getCall(0).args).toEqual([`attempting to install licensed gem matching "${version}"`]);
87-
expect(core.info.getCall(1).args).toEqual([`attempting to install licensed executable matching "${version}"`]);
88+
expect(core.info.getCall(1).args).toEqual(['gem installation was not successful']);
89+
expect(core.info.getCall(2).args).toEqual([`attempting to install licensed executable matching "${version}"`]);
90+
expect(core.info.getCall(3).args).toEqual(['exe installation was not successful']);
8891
});
8992
});

0 commit comments

Comments
 (0)