Skip to content

Commit 90d954c

Browse files
committed
fix: asdf on (we switched to nodeJS), let's use deno instead. Fixed github cli already being installed
1 parent 4cf0a6c commit 90d954c

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

scripts/cleanup-github-actions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ if (Utils.isLinux()) {
99
// Uninstall resources that have Codify resource definitions
1010
await PluginTester.uninstall(pluginPath, [
1111
{ type: 'docker' },
12-
{ type: 'aws-cli'}
12+
{ type: 'aws-cli'},
13+
{ type: 'github-cli' },
1314
]);
1415

1516
await testSpawn('apt-get autoremove -y ruby rpm python awscli needrestart', { requiresRoot: true }); // remove needrestart to keep logs clean.
@@ -26,6 +27,7 @@ if (Utils.isLinux()) {
2627
} else {
2728
await PluginTester.uninstall(pluginPath, [
2829
{ type: 'aws-cli' },
30+
{ type: 'github-cli' }
2931
]);
3032

3133
await testSpawn('brew uninstall ant gradle kotlin maven selenium-server google-chrome pipx $(brew list | grep -E \'^python(@|$)\') $(brew list | grep -E \'^ruby(@|$)\') aws-sam-cli azure-cli rustup git-lfs $(brew list | grep -E \'^openjdk(@|$)\')', { interactive: true });

test/asdf/asdf-install.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Asdf install tests', async () => {
1212
await fs.mkdir(path.join(os.homedir(), 'toolDir'), { recursive: true });
1313
await fs.writeFile(
1414
path.join(os.homedir(), '.tool-versions'),
15-
'nodejs 22.0.0\n' +
15+
'deno 2.0.0\n' +
1616
'golang 1.23.0'
1717
)
1818

@@ -27,13 +27,13 @@ describe('Asdf install tests', async () => {
2727
], {
2828
validateApply: async () => {
2929
expect(await testSpawn('which asdf')).toMatchObject({ status: SpawnStatus.SUCCESS })
30-
expect(await testSpawn('which node')).toMatchObject({ status: SpawnStatus.SUCCESS });
30+
expect(await testSpawn('which deno')).toMatchObject({ status: SpawnStatus.SUCCESS });
3131
expect(await testSpawn('which go')).toMatchObject({ status: SpawnStatus.SUCCESS });
3232

3333
},
3434
validateDestroy: async () => {
3535
expect(await testSpawn('which asdf')).toMatchObject({ status: SpawnStatus.ERROR });
36-
expect(await testSpawn('which node')).toMatchObject({ status: SpawnStatus.ERROR });
36+
expect(await testSpawn('which deno')).toMatchObject({ status: SpawnStatus.ERROR });
3737
expect(await testSpawn('which go')).toMatchObject({ status: SpawnStatus.ERROR });
3838
}
3939
});

test/github-cli/github-cli.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { SpawnStatus } from '@codifycli/plugin-core';
22
import { PluginTester, testSpawn } from '@codifycli/plugin-test';
33
import * as path from 'node:path';
4-
import { describe, expect, it } from 'vitest';
4+
import { beforeAll, describe, expect, it } from 'vitest';
55

66
describe('GitHub CLI integration tests', async () => {
77
const pluginPath = path.resolve('./src/index.ts');
88

9+
beforeAll(async () => {
10+
await PluginTester.uninstall(pluginPath, [{ type: 'github-cli' }]);
11+
}, 60_000);
12+
913
it('Can install and uninstall GitHub CLI', { timeout: 300_000 }, async () => {
1014
await PluginTester.fullTest(
1115
pluginPath,
@@ -79,7 +83,6 @@ describe('GitHub CLI integration tests', async () => {
7983
},
8084
testModify: {
8185
modifiedConfigs: [
82-
{ type: 'github-cli' },
8386
{
8487
type: 'github-cli-alias',
8588
alias: 'codify-test-alias',

0 commit comments

Comments
 (0)