@invarn/cibuild 1.3.16 → 1.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +987 -0
- package/dist/src/commands/android-scanner.d.ts +32 -0
- package/dist/src/commands/android-scanner.d.ts.map +1 -0
- package/dist/src/commands/android-scanner.js +667 -0
- package/dist/src/commands/build.d.ts +5 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +1096 -0
- package/dist/src/commands/edit.d.ts +3 -0
- package/dist/src/commands/edit.d.ts.map +1 -0
- package/dist/src/commands/edit.js +651 -0
- package/dist/src/commands/file-secret-collector.d.ts +37 -0
- package/dist/src/commands/file-secret-collector.d.ts.map +1 -0
- package/dist/src/commands/file-secret-collector.js +199 -0
- package/dist/src/commands/github-workflow.d.ts +5 -0
- package/dist/src/commands/github-workflow.d.ts.map +1 -0
- package/dist/src/commands/github-workflow.js +45 -0
- package/dist/src/commands/ios-scanner.d.ts +27 -0
- package/dist/src/commands/ios-scanner.d.ts.map +1 -0
- package/dist/src/commands/ios-scanner.js +337 -0
- package/dist/src/commands/reset.d.ts +7 -0
- package/dist/src/commands/reset.d.ts.map +1 -0
- package/dist/src/commands/reset.js +81 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts +15 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +1 -0
- package/dist/src/commands/secrets-sync-workflow.js +255 -0
- package/dist/src/commands/secrets-upload.d.ts +21 -0
- package/dist/src/commands/secrets-upload.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.js +177 -0
- package/dist/src/commands/secrets-upload.test.d.ts +5 -0
- package/dist/src/commands/secrets-upload.test.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.test.js +60 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +47 -0
- package/dist/src/envman/cli.d.ts +21 -0
- package/dist/src/envman/cli.d.ts.map +1 -0
- package/dist/src/envman/cli.js +240 -0
- package/dist/src/envman/envman.d.ts +83 -0
- package/dist/src/envman/envman.d.ts.map +1 -0
- package/dist/src/envman/envman.js +361 -0
- package/dist/src/envman/envman.test.d.ts +5 -0
- package/dist/src/envman/envman.test.d.ts.map +1 -0
- package/dist/src/envman/envman.test.js +236 -0
- package/dist/src/envman/index.d.ts +23 -0
- package/dist/src/envman/index.d.ts.map +1 -0
- package/dist/src/envman/index.js +23 -0
- package/dist/src/envman/types.d.ts +55 -0
- package/dist/src/envman/types.d.ts.map +1 -0
- package/dist/src/envman/types.js +12 -0
- package/dist/src/lib.d.ts +27 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +32 -0
- package/dist/src/pipeline.d.ts +3 -0
- package/dist/src/pipeline.d.ts.map +1 -0
- package/dist/src/pipeline.js +57 -0
- package/dist/src/runner.d.ts +17 -0
- package/dist/src/runner.d.ts.map +1 -0
- package/dist/src/runner.js +234 -0
- package/dist/src/types.d.ts +58 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/yaml/bitrise-compat.d.ts +65 -0
- package/dist/src/yaml/bitrise-compat.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.js +206 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts +5 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.test.js +347 -0
- package/dist/src/yaml/converter.d.ts +33 -0
- package/dist/src/yaml/converter.d.ts.map +1 -0
- package/dist/src/yaml/converter.js +222 -0
- package/dist/src/yaml/converter.test.d.ts +5 -0
- package/dist/src/yaml/converter.test.d.ts.map +1 -0
- package/dist/src/yaml/converter.test.js +348 -0
- package/dist/src/yaml/e2e.test.d.ts +6 -0
- package/dist/src/yaml/e2e.test.d.ts.map +1 -0
- package/dist/src/yaml/e2e.test.js +446 -0
- package/dist/src/yaml/env-resolver.d.ts +120 -0
- package/dist/src/yaml/env-resolver.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.js +405 -0
- package/dist/src/yaml/env-resolver.test.d.ts +5 -0
- package/dist/src/yaml/env-resolver.test.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.test.js +502 -0
- package/dist/src/yaml/interactive-prompts.d.ts +71 -0
- package/dist/src/yaml/interactive-prompts.d.ts.map +1 -0
- package/dist/src/yaml/interactive-prompts.js +258 -0
- package/dist/src/yaml/missing-env-handler.d.ts +45 -0
- package/dist/src/yaml/missing-env-handler.d.ts.map +1 -0
- package/dist/src/yaml/missing-env-handler.js +64 -0
- package/dist/src/yaml/parser.d.ts +33 -0
- package/dist/src/yaml/parser.d.ts.map +1 -0
- package/dist/src/yaml/parser.js +145 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts +25 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +1 -0
- package/dist/src/yaml/pipeline-with-secrets.js +76 -0
- package/dist/src/yaml/platform-detector.d.ts +83 -0
- package/dist/src/yaml/platform-detector.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.js +188 -0
- package/dist/src/yaml/platform-detector.test.d.ts +5 -0
- package/dist/src/yaml/platform-detector.test.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.test.js +414 -0
- package/dist/src/yaml/preflight-validation.d.ts +40 -0
- package/dist/src/yaml/preflight-validation.d.ts.map +1 -0
- package/dist/src/yaml/preflight-validation.js +152 -0
- package/dist/src/yaml/secrets-manager.d.ts +77 -0
- package/dist/src/yaml/secrets-manager.d.ts.map +1 -0
- package/dist/src/yaml/secrets-manager.js +219 -0
- package/dist/src/yaml/step-validator.d.ts +54 -0
- package/dist/src/yaml/step-validator.d.ts.map +1 -0
- package/dist/src/yaml/step-validator.js +403 -0
- package/dist/src/yaml/steps/android-sign.d.ts +35 -0
- package/dist/src/yaml/steps/android-sign.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-sign.js +147 -0
- package/dist/src/yaml/steps/android-version.d.ts +26 -0
- package/dist/src/yaml/steps/android-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.js +128 -0
- package/dist/src/yaml/steps/android-version.test.d.ts +5 -0
- package/dist/src/yaml/steps/android-version.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.test.js +196 -0
- package/dist/src/yaml/steps/android.d.ts +95 -0
- package/dist/src/yaml/steps/android.d.ts.map +1 -0
- package/dist/src/yaml/steps/android.js +916 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts +48 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/app-store-deploy.js +162 -0
- package/dist/src/yaml/steps/base.d.ts +238 -0
- package/dist/src/yaml/steps/base.d.ts.map +1 -0
- package/dist/src/yaml/steps/base.js +345 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +26 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.js +198 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +280 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +22 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.js +144 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +331 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts +49 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.js +280 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.test.js +484 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +27 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.js +134 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.js +205 -0
- package/dist/src/yaml/steps/cache.d.ts +52 -0
- package/dist/src/yaml/steps/cache.d.ts.map +1 -0
- package/dist/src/yaml/steps/cache.js +352 -0
- package/dist/src/yaml/steps/fastlane.d.ts +27 -0
- package/dist/src/yaml/steps/fastlane.d.ts.map +1 -0
- package/dist/src/yaml/steps/fastlane.js +79 -0
- package/dist/src/yaml/steps/file.d.ts +27 -0
- package/dist/src/yaml/steps/file.d.ts.map +1 -0
- package/dist/src/yaml/steps/file.js +35 -0
- package/dist/src/yaml/steps/flutter.d.ts +63 -0
- package/dist/src/yaml/steps/flutter.d.ts.map +1 -0
- package/dist/src/yaml/steps/flutter.js +215 -0
- package/dist/src/yaml/steps/git-clone.d.ts +26 -0
- package/dist/src/yaml/steps/git-clone.d.ts.map +1 -0
- package/dist/src/yaml/steps/git-clone.js +111 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts +37 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.js +193 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +5 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.test.js +310 -0
- package/dist/src/yaml/steps/index.d.ts +10 -0
- package/dist/src/yaml/steps/index.d.ts.map +1 -0
- package/dist/src/yaml/steps/index.js +1361 -0
- package/dist/src/yaml/steps/ios-deps.d.ts +43 -0
- package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.js +141 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts +5 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.test.js +90 -0
- package/dist/src/yaml/steps/ios-signing.d.ts +31 -0
- package/dist/src/yaml/steps/ios-signing.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-signing.js +144 -0
- package/dist/src/yaml/steps/ios-version.d.ts +47 -0
- package/dist/src/yaml/steps/ios-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-version.js +151 -0
- package/dist/src/yaml/steps/linting.d.ts +47 -0
- package/dist/src/yaml/steps/linting.d.ts.map +1 -0
- package/dist/src/yaml/steps/linting.js +148 -0
- package/dist/src/yaml/steps/phase2.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase2.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase2.test.js +197 -0
- package/dist/src/yaml/steps/phase3.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase3.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase3.test.js +144 -0
- package/dist/src/yaml/steps/phase4.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase4.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase4.test.js +166 -0
- package/dist/src/yaml/steps/phase5.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase5.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase5.test.js +263 -0
- package/dist/src/yaml/steps/registry.d.ts +88 -0
- package/dist/src/yaml/steps/registry.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.js +125 -0
- package/dist/src/yaml/steps/registry.test.d.ts +5 -0
- package/dist/src/yaml/steps/registry.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.test.js +235 -0
- package/dist/src/yaml/steps/release.d.ts +50 -0
- package/dist/src/yaml/steps/release.d.ts.map +1 -0
- package/dist/src/yaml/steps/release.js +154 -0
- package/dist/src/yaml/steps/script.d.ts +23 -0
- package/dist/src/yaml/steps/script.d.ts.map +1 -0
- package/dist/src/yaml/steps/script.js +63 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts +6 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/spec-validation.test.js +130 -0
- package/dist/src/yaml/steps/steps.test.d.ts +6 -0
- package/dist/src/yaml/steps/steps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/steps.test.js +505 -0
- package/dist/src/yaml/steps/test-config.d.ts +3 -0
- package/dist/src/yaml/steps/test-config.d.ts.map +1 -0
- package/dist/src/yaml/steps/test-config.js +17 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts +5 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-new.test.js +211 -0
- package/dist/src/yaml/steps/xcode.d.ts +222 -0
- package/dist/src/yaml/steps/xcode.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode.js +999 -0
- package/dist/src/yaml/types.d.ts +68 -0
- package/dist/src/yaml/types.d.ts.map +1 -0
- package/dist/src/yaml/types.js +5 -0
- package/dist/src/yaml/validation-types.d.ts +96 -0
- package/dist/src/yaml/validation-types.d.ts.map +1 -0
- package/dist/src/yaml/validation-types.js +8 -0
- package/dist/src/yaml/yaml-updater.d.ts +24 -0
- package/dist/src/yaml/yaml-updater.d.ts.map +1 -0
- package/dist/src/yaml/yaml-updater.js +128 -0
- package/package.json +16 -4
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Phase 3 steps: certificate-installer, fastlane
|
|
3
|
+
*/
|
|
4
|
+
import { describe, test, expect } from '@jest/globals';
|
|
5
|
+
import { CertificateInstallerStepExecutor } from './ios-signing.js';
|
|
6
|
+
import { FastlaneStepExecutor } from './fastlane.js';
|
|
7
|
+
import { testConfig } from './test-config.js';
|
|
8
|
+
describe('CertificateInstallerStepExecutor', () => {
|
|
9
|
+
test('should generate certificate installation script', async () => {
|
|
10
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
11
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
12
|
+
expect(result.kind).toBe('script');
|
|
13
|
+
expect(result.name).toBe('certificate-installer');
|
|
14
|
+
expect(result.script).toContain('security');
|
|
15
|
+
expect(result.script).toContain('keychain');
|
|
16
|
+
});
|
|
17
|
+
test('should unlock the keychain', async () => {
|
|
18
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
19
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
20
|
+
expect(result.script).toContain('security unlock-keychain');
|
|
21
|
+
});
|
|
22
|
+
test('should create keychain if it does not exist', async () => {
|
|
23
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
24
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
25
|
+
expect(result.script).toContain('security create-keychain');
|
|
26
|
+
});
|
|
27
|
+
test('should add keychain to search list', async () => {
|
|
28
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
29
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
30
|
+
expect(result.script).toContain('security list-keychains');
|
|
31
|
+
expect(result.script).toContain('default-keychain');
|
|
32
|
+
});
|
|
33
|
+
test('should install certificates from URLs', async () => {
|
|
34
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
35
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
36
|
+
expect(result.script).toContain('security import');
|
|
37
|
+
expect(result.script).toContain('.p12');
|
|
38
|
+
expect(result.script).toContain('codesign');
|
|
39
|
+
});
|
|
40
|
+
test('should support file:// certificate URLs', async () => {
|
|
41
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
42
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
43
|
+
expect(result.script).toContain('file://');
|
|
44
|
+
});
|
|
45
|
+
test('should install provisioning profiles', async () => {
|
|
46
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
47
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
48
|
+
expect(result.script).toContain('Provisioning Profiles');
|
|
49
|
+
expect(result.script).toContain('mobileprovision');
|
|
50
|
+
});
|
|
51
|
+
test('should extract UUID from provisioning profiles', async () => {
|
|
52
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
53
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
54
|
+
expect(result.script).toContain('UUID');
|
|
55
|
+
expect(result.script).toContain('PlistBuddy');
|
|
56
|
+
});
|
|
57
|
+
test('should support custom keychain path', async () => {
|
|
58
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
59
|
+
const result = await executor.execute({ keychain_path: '/tmp/test.keychain' }, {}, testConfig);
|
|
60
|
+
expect(result.script).toContain('/tmp/test.keychain');
|
|
61
|
+
});
|
|
62
|
+
test('should set key partition list for codesign', async () => {
|
|
63
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
64
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
65
|
+
expect(result.script).toContain('set-key-partition-list');
|
|
66
|
+
expect(result.script).toContain('codesign');
|
|
67
|
+
});
|
|
68
|
+
test('should support pipe-separated certificate URLs', async () => {
|
|
69
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
70
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
71
|
+
expect(result.script).toContain('IFS="|"');
|
|
72
|
+
expect(result.script).toContain('URL_ARRAY');
|
|
73
|
+
});
|
|
74
|
+
test('should enable verbose logging when requested', async () => {
|
|
75
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
76
|
+
const result = await executor.execute({ verbose: 'true' }, {}, testConfig);
|
|
77
|
+
expect(result.script).toContain('find-identity');
|
|
78
|
+
expect(result.script).toContain('codesigning');
|
|
79
|
+
});
|
|
80
|
+
test('should declare no outputs', () => {
|
|
81
|
+
const executor = new CertificateInstallerStepExecutor();
|
|
82
|
+
const outputs = executor.getOutputs();
|
|
83
|
+
expect(outputs).toHaveLength(0);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('FastlaneStepExecutor', () => {
|
|
87
|
+
test('should require lane input', async () => {
|
|
88
|
+
const executor = new FastlaneStepExecutor();
|
|
89
|
+
await expect(executor.execute({}, {}, testConfig)).rejects.toThrow("Missing required input 'lane'");
|
|
90
|
+
});
|
|
91
|
+
test('should generate fastlane script', async () => {
|
|
92
|
+
const executor = new FastlaneStepExecutor();
|
|
93
|
+
const result = await executor.execute({ lane: 'ios release' }, {}, testConfig);
|
|
94
|
+
expect(result.kind).toBe('script');
|
|
95
|
+
expect(result.name).toBe('fastlane');
|
|
96
|
+
expect(result.script).toContain('fastlane');
|
|
97
|
+
expect(result.script).toContain('ios release');
|
|
98
|
+
});
|
|
99
|
+
test('should detect Gemfile for bundle exec', async () => {
|
|
100
|
+
const executor = new FastlaneStepExecutor();
|
|
101
|
+
const result = await executor.execute({ lane: 'beta' }, {}, testConfig);
|
|
102
|
+
expect(result.script).toContain('Gemfile');
|
|
103
|
+
expect(result.script).toContain('bundle exec');
|
|
104
|
+
expect(result.script).toContain('USE_BUNDLE_EXEC');
|
|
105
|
+
});
|
|
106
|
+
test('should support custom working directory', async () => {
|
|
107
|
+
const executor = new FastlaneStepExecutor();
|
|
108
|
+
const result = await executor.execute({ lane: 'deploy', work_dir: './ios' }, {}, testConfig);
|
|
109
|
+
expect(result.script).toContain("cd './ios'");
|
|
110
|
+
});
|
|
111
|
+
test('should update fastlane gem by default', async () => {
|
|
112
|
+
const executor = new FastlaneStepExecutor();
|
|
113
|
+
const result = await executor.execute({ lane: 'beta' }, {}, testConfig);
|
|
114
|
+
expect(result.script).toContain('gem install fastlane');
|
|
115
|
+
expect(result.script).toContain('bundle install');
|
|
116
|
+
});
|
|
117
|
+
test('should skip update when update_fastlane is false', async () => {
|
|
118
|
+
const executor = new FastlaneStepExecutor();
|
|
119
|
+
const result = await executor.execute({ lane: 'beta', update_fastlane: 'false' }, {}, testConfig);
|
|
120
|
+
expect(result.script).not.toContain('gem install fastlane');
|
|
121
|
+
});
|
|
122
|
+
test('should support verbose logging', async () => {
|
|
123
|
+
const executor = new FastlaneStepExecutor();
|
|
124
|
+
const result = await executor.execute({ lane: 'beta', verbose_log: 'yes' }, {}, testConfig);
|
|
125
|
+
expect(result.script).toContain('--verbose');
|
|
126
|
+
});
|
|
127
|
+
test('should support enable_cache option', async () => {
|
|
128
|
+
const executor = new FastlaneStepExecutor();
|
|
129
|
+
const result = await executor.execute({ lane: 'beta', enable_cache: 'yes' }, {}, testConfig);
|
|
130
|
+
expect(result.script).toContain('Podfile.lock');
|
|
131
|
+
expect(result.script).toContain('Cartfile.resolved');
|
|
132
|
+
});
|
|
133
|
+
test('should skip cache when disabled', async () => {
|
|
134
|
+
const executor = new FastlaneStepExecutor();
|
|
135
|
+
const result = await executor.execute({ lane: 'beta', enable_cache: 'no' }, {}, testConfig);
|
|
136
|
+
expect(result.script).not.toContain('Podfile.lock');
|
|
137
|
+
});
|
|
138
|
+
test('should declare no outputs', () => {
|
|
139
|
+
const executor = new FastlaneStepExecutor();
|
|
140
|
+
const outputs = executor.getOutputs();
|
|
141
|
+
expect(outputs).toHaveLength(0);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=phase3.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase4.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/phase4.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Phase 4 steps: swiftlint, detekt, export-xcarchive
|
|
3
|
+
*/
|
|
4
|
+
import { describe, test, expect } from '@jest/globals';
|
|
5
|
+
import { SwiftlintStepExecutor, DetektStepExecutor } from './linting.js';
|
|
6
|
+
import { ExportXcarchiveStepExecutor } from './xcode.js';
|
|
7
|
+
import { testConfig } from './test-config.js';
|
|
8
|
+
describe('SwiftlintStepExecutor', () => {
|
|
9
|
+
test('should generate swiftlint script', async () => {
|
|
10
|
+
const executor = new SwiftlintStepExecutor();
|
|
11
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
12
|
+
expect(result.kind).toBe('script');
|
|
13
|
+
expect(result.name).toBe('swiftlint');
|
|
14
|
+
expect(result.script).toContain('swiftlint');
|
|
15
|
+
});
|
|
16
|
+
test('should support custom linting path', async () => {
|
|
17
|
+
const executor = new SwiftlintStepExecutor();
|
|
18
|
+
const result = await executor.execute({ linting_path: './Sources' }, {}, testConfig);
|
|
19
|
+
expect(result.script).toContain('./Sources');
|
|
20
|
+
});
|
|
21
|
+
test('should support changed files only', async () => {
|
|
22
|
+
const executor = new SwiftlintStepExecutor();
|
|
23
|
+
const result = await executor.execute({ lint_range: 'changed' }, {}, testConfig);
|
|
24
|
+
expect(result.script).toContain('git diff');
|
|
25
|
+
expect(result.script).toContain('.swift');
|
|
26
|
+
});
|
|
27
|
+
test('should support custom config file', async () => {
|
|
28
|
+
const executor = new SwiftlintStepExecutor();
|
|
29
|
+
const result = await executor.execute({ lint_config_file: '.swiftlint-ci.yml' }, {}, testConfig);
|
|
30
|
+
expect(result.script).toContain('--config');
|
|
31
|
+
expect(result.script).toContain('.swiftlint-ci.yml');
|
|
32
|
+
});
|
|
33
|
+
test('should support reporter option', async () => {
|
|
34
|
+
const executor = new SwiftlintStepExecutor();
|
|
35
|
+
const result = await executor.execute({ reporter: 'json' }, {}, testConfig);
|
|
36
|
+
expect(result.script).toContain('--reporter json');
|
|
37
|
+
expect(result.script).toContain('swiftlint_report.json');
|
|
38
|
+
});
|
|
39
|
+
test('should support strict mode', async () => {
|
|
40
|
+
const executor = new SwiftlintStepExecutor();
|
|
41
|
+
const result = await executor.execute({ strict: 'yes' }, {}, testConfig);
|
|
42
|
+
expect(result.script).toContain('--strict');
|
|
43
|
+
});
|
|
44
|
+
test('should support quiet mode', async () => {
|
|
45
|
+
const executor = new SwiftlintStepExecutor();
|
|
46
|
+
const result = await executor.execute({ quiet: 'yes' }, {}, testConfig);
|
|
47
|
+
expect(result.script).toContain('--quiet');
|
|
48
|
+
});
|
|
49
|
+
test('should export report outputs', async () => {
|
|
50
|
+
const executor = new SwiftlintStepExecutor();
|
|
51
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
52
|
+
expect(result.script).toContain('CIBUILD_SWIFTLINT_REPORT');
|
|
53
|
+
expect(result.script).toContain('CIBUILD_SWIFTLINT_REPORT_PATH');
|
|
54
|
+
});
|
|
55
|
+
test('should declare outputs', () => {
|
|
56
|
+
const executor = new SwiftlintStepExecutor();
|
|
57
|
+
const outputs = executor.getOutputs();
|
|
58
|
+
expect(outputs).toHaveLength(2);
|
|
59
|
+
expect(outputs[0].name).toBe('CIBUILD_SWIFTLINT_REPORT');
|
|
60
|
+
expect(outputs[1].name).toBe('CIBUILD_SWIFTLINT_REPORT_PATH');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('DetektStepExecutor', () => {
|
|
64
|
+
test('should generate detekt script', async () => {
|
|
65
|
+
const executor = new DetektStepExecutor();
|
|
66
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
67
|
+
expect(result.kind).toBe('script');
|
|
68
|
+
expect(result.name).toBe('detekt');
|
|
69
|
+
expect(result.script).toContain('detekt');
|
|
70
|
+
expect(result.script).toContain('gradlew');
|
|
71
|
+
});
|
|
72
|
+
test('should support custom project location', async () => {
|
|
73
|
+
const executor = new DetektStepExecutor();
|
|
74
|
+
const result = await executor.execute({ project_location: './android' }, {}, testConfig);
|
|
75
|
+
expect(result.script).toContain('./android');
|
|
76
|
+
});
|
|
77
|
+
test('should support module-level detekt', async () => {
|
|
78
|
+
const executor = new DetektStepExecutor();
|
|
79
|
+
const result = await executor.execute({ module: 'app' }, {}, testConfig);
|
|
80
|
+
expect(result.script).toContain(':app:detekt');
|
|
81
|
+
});
|
|
82
|
+
test('should support extra gradle arguments', async () => {
|
|
83
|
+
const executor = new DetektStepExecutor();
|
|
84
|
+
const result = await executor.execute({ arguments: '--stacktrace' }, {}, testConfig);
|
|
85
|
+
expect(result.script).toContain('--stacktrace');
|
|
86
|
+
});
|
|
87
|
+
test('should verify gradlew exists', async () => {
|
|
88
|
+
const executor = new DetektStepExecutor();
|
|
89
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
90
|
+
expect(result.script).toContain('gradlew not found');
|
|
91
|
+
expect(result.script).toContain('exit 1');
|
|
92
|
+
});
|
|
93
|
+
test('should find report files', async () => {
|
|
94
|
+
const executor = new DetektStepExecutor();
|
|
95
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
96
|
+
expect(result.script).toContain('reports/detekt');
|
|
97
|
+
});
|
|
98
|
+
test('should declare no outputs', () => {
|
|
99
|
+
const executor = new DetektStepExecutor();
|
|
100
|
+
const outputs = executor.getOutputs();
|
|
101
|
+
expect(outputs).toHaveLength(0);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe('ExportXcarchiveStepExecutor', () => {
|
|
105
|
+
test('should require archive_path', async () => {
|
|
106
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
107
|
+
await expect(executor.execute({}, {}, testConfig)).rejects.toThrow("Missing required input 'archive_path'");
|
|
108
|
+
});
|
|
109
|
+
test('should generate export script', async () => {
|
|
110
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
111
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive' }, {}, testConfig);
|
|
112
|
+
expect(result.kind).toBe('script');
|
|
113
|
+
expect(result.name).toBe('export-xcarchive');
|
|
114
|
+
expect(result.script).toContain('xcodebuild -exportArchive');
|
|
115
|
+
expect(result.script).toContain('MyApp.xcarchive');
|
|
116
|
+
});
|
|
117
|
+
test('should validate archive exists', async () => {
|
|
118
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
119
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive' }, {}, testConfig);
|
|
120
|
+
expect(result.script).toContain('Archive not found');
|
|
121
|
+
expect(result.script).toContain('exit 1');
|
|
122
|
+
});
|
|
123
|
+
test('should generate ExportOptions.plist', async () => {
|
|
124
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
125
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive', distribution_method: 'ad-hoc' }, {}, testConfig);
|
|
126
|
+
expect(result.script).toContain('ExportOptions.plist');
|
|
127
|
+
expect(result.script).toContain('ad-hoc');
|
|
128
|
+
});
|
|
129
|
+
test('should support custom ExportOptions.plist content', async () => {
|
|
130
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
131
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive', export_options_plist_content: '<plist>custom</plist>' }, {}, testConfig);
|
|
132
|
+
expect(result.script).toContain('<plist>custom</plist>');
|
|
133
|
+
});
|
|
134
|
+
test('should handle Xcode 15.3+ distribution method remapping', async () => {
|
|
135
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
136
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive', distribution_method: 'development' }, {}, testConfig);
|
|
137
|
+
expect(result.script).toContain('debugging');
|
|
138
|
+
expect(result.script).toContain('app-store-connect');
|
|
139
|
+
expect(result.script).toContain('release-testing');
|
|
140
|
+
});
|
|
141
|
+
test('should find exported IPA', async () => {
|
|
142
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
143
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive' }, {}, testConfig);
|
|
144
|
+
expect(result.script).toContain('find "$EXPORT_DIR" -name "*.ipa"');
|
|
145
|
+
});
|
|
146
|
+
test('should collect and zip dSYMs', async () => {
|
|
147
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
148
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive' }, {}, testConfig);
|
|
149
|
+
expect(result.script).toContain('dSYMs');
|
|
150
|
+
expect(result.script).toContain('zip');
|
|
151
|
+
});
|
|
152
|
+
test('should export IPA and dSYM paths', async () => {
|
|
153
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
154
|
+
const result = await executor.execute({ archive_path: 'build/MyApp.xcarchive' }, {}, testConfig);
|
|
155
|
+
expect(result.script).toContain('CIBUILD_IPA_PATH');
|
|
156
|
+
expect(result.script).toContain('CIBUILD_DSYM_PATH');
|
|
157
|
+
});
|
|
158
|
+
test('should declare outputs', () => {
|
|
159
|
+
const executor = new ExportXcarchiveStepExecutor();
|
|
160
|
+
const outputs = executor.getOutputs();
|
|
161
|
+
expect(outputs).toHaveLength(2);
|
|
162
|
+
expect(outputs[0].name).toBe('CIBUILD_IPA_PATH');
|
|
163
|
+
expect(outputs[1].name).toBe('CIBUILD_DSYM_PATH');
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=phase4.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase5.test.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/phase5.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Phase 5 steps: flutter-installer, flutter-build, flutter-test,
|
|
3
|
+
* generate-changelog, github-release
|
|
4
|
+
*/
|
|
5
|
+
import { describe, test, expect } from '@jest/globals';
|
|
6
|
+
import { FlutterInstallerStepExecutor, FlutterBuildStepExecutor, FlutterTestStepExecutor } from './flutter.js';
|
|
7
|
+
import { GenerateChangelogStepExecutor, GithubReleaseStepExecutor } from './release.js';
|
|
8
|
+
import { testConfig } from './test-config.js';
|
|
9
|
+
describe('FlutterInstallerStepExecutor', () => {
|
|
10
|
+
test('should generate flutter install script', async () => {
|
|
11
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
12
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
13
|
+
expect(result.kind).toBe('script');
|
|
14
|
+
expect(result.name).toBe('flutter-installer');
|
|
15
|
+
expect(result.script).toContain('flutter');
|
|
16
|
+
});
|
|
17
|
+
test('should clone Flutter repo', async () => {
|
|
18
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
19
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
20
|
+
expect(result.script).toContain('git clone');
|
|
21
|
+
expect(result.script).toContain('github.com/flutter/flutter');
|
|
22
|
+
});
|
|
23
|
+
test('should add Flutter to PATH', async () => {
|
|
24
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
25
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
26
|
+
expect(result.script).toContain('PATH');
|
|
27
|
+
expect(result.script).toContain('bin');
|
|
28
|
+
});
|
|
29
|
+
test('should support channel switching', async () => {
|
|
30
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
31
|
+
const result = await executor.execute({ version: 'beta' }, {}, testConfig);
|
|
32
|
+
expect(result.script).toContain('beta');
|
|
33
|
+
expect(result.script).toContain('flutter channel');
|
|
34
|
+
});
|
|
35
|
+
test('should run flutter precache and doctor', async () => {
|
|
36
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
37
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
38
|
+
expect(result.script).toContain('flutter precache');
|
|
39
|
+
expect(result.script).toContain('flutter doctor');
|
|
40
|
+
});
|
|
41
|
+
test('should support custom install path', async () => {
|
|
42
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
43
|
+
const result = await executor.execute({ installation_path: '/opt/flutter' }, {}, testConfig);
|
|
44
|
+
expect(result.script).toContain('/opt/flutter');
|
|
45
|
+
});
|
|
46
|
+
test('should export SDK path', async () => {
|
|
47
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
48
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
49
|
+
expect(result.script).toContain('CIBUILD_FLUTTER_SDK_PATH');
|
|
50
|
+
});
|
|
51
|
+
test('should declare outputs', () => {
|
|
52
|
+
const executor = new FlutterInstallerStepExecutor();
|
|
53
|
+
const outputs = executor.getOutputs();
|
|
54
|
+
expect(outputs).toHaveLength(1);
|
|
55
|
+
expect(outputs[0].name).toBe('CIBUILD_FLUTTER_SDK_PATH');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('FlutterBuildStepExecutor', () => {
|
|
59
|
+
test('should generate flutter build script', async () => {
|
|
60
|
+
const executor = new FlutterBuildStepExecutor();
|
|
61
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
62
|
+
expect(result.kind).toBe('script');
|
|
63
|
+
expect(result.name).toBe('flutter-build');
|
|
64
|
+
expect(result.script).toContain('flutter build');
|
|
65
|
+
});
|
|
66
|
+
test('should build both platforms by default', async () => {
|
|
67
|
+
const executor = new FlutterBuildStepExecutor();
|
|
68
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
69
|
+
expect(result.script).toContain('Build iOS');
|
|
70
|
+
expect(result.script).toContain('Build Android');
|
|
71
|
+
});
|
|
72
|
+
test('should build only iOS when platform is ios', async () => {
|
|
73
|
+
const executor = new FlutterBuildStepExecutor();
|
|
74
|
+
const result = await executor.execute({ platform: 'ios' }, {}, testConfig);
|
|
75
|
+
expect(result.script).toContain('Build iOS');
|
|
76
|
+
expect(result.script).not.toContain('Build Android');
|
|
77
|
+
});
|
|
78
|
+
test('should build only Android when platform is android', async () => {
|
|
79
|
+
const executor = new FlutterBuildStepExecutor();
|
|
80
|
+
const result = await executor.execute({ platform: 'android' }, {}, testConfig);
|
|
81
|
+
expect(result.script).toContain('Build Android');
|
|
82
|
+
expect(result.script).not.toContain('Build iOS');
|
|
83
|
+
});
|
|
84
|
+
test('should support appbundle output type', async () => {
|
|
85
|
+
const executor = new FlutterBuildStepExecutor();
|
|
86
|
+
const result = await executor.execute({ platform: 'android', android_output_type: 'appbundle' }, {}, testConfig);
|
|
87
|
+
expect(result.script).toContain('flutter build appbundle');
|
|
88
|
+
expect(result.script).toContain('CIBUILD_AAB_PATH');
|
|
89
|
+
});
|
|
90
|
+
test('should support APK output type', async () => {
|
|
91
|
+
const executor = new FlutterBuildStepExecutor();
|
|
92
|
+
const result = await executor.execute({ platform: 'android', android_output_type: 'apk' }, {}, testConfig);
|
|
93
|
+
expect(result.script).toContain('flutter build apk');
|
|
94
|
+
expect(result.script).toContain('CIBUILD_APK_PATH');
|
|
95
|
+
});
|
|
96
|
+
test('should support iOS archive output', async () => {
|
|
97
|
+
const executor = new FlutterBuildStepExecutor();
|
|
98
|
+
const result = await executor.execute({ platform: 'ios', ios_output_type: 'archive' }, {}, testConfig);
|
|
99
|
+
expect(result.script).toContain('flutter build ipa');
|
|
100
|
+
});
|
|
101
|
+
test('should run flutter pub get', async () => {
|
|
102
|
+
const executor = new FlutterBuildStepExecutor();
|
|
103
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
104
|
+
expect(result.script).toContain('flutter pub get');
|
|
105
|
+
});
|
|
106
|
+
test('should support additional build params', async () => {
|
|
107
|
+
const executor = new FlutterBuildStepExecutor();
|
|
108
|
+
const result = await executor.execute({ platform: 'android', additional_build_params: '--build-number=42' }, {}, testConfig);
|
|
109
|
+
expect(result.script).toContain('--build-number=42');
|
|
110
|
+
});
|
|
111
|
+
test('should declare outputs', () => {
|
|
112
|
+
const executor = new FlutterBuildStepExecutor();
|
|
113
|
+
const outputs = executor.getOutputs();
|
|
114
|
+
expect(outputs).toHaveLength(3);
|
|
115
|
+
expect(outputs.map(o => o.name)).toContain('CIBUILD_APK_PATH');
|
|
116
|
+
expect(outputs.map(o => o.name)).toContain('CIBUILD_AAB_PATH');
|
|
117
|
+
expect(outputs.map(o => o.name)).toContain('CIBUILD_APP_DIR_PATH');
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
describe('FlutterTestStepExecutor', () => {
|
|
121
|
+
test('should generate flutter test script', async () => {
|
|
122
|
+
const executor = new FlutterTestStepExecutor();
|
|
123
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
124
|
+
expect(result.kind).toBe('script');
|
|
125
|
+
expect(result.name).toBe('flutter-test');
|
|
126
|
+
expect(result.script).toContain('flutter test');
|
|
127
|
+
});
|
|
128
|
+
test('should support coverage collection', async () => {
|
|
129
|
+
const executor = new FlutterTestStepExecutor();
|
|
130
|
+
const result = await executor.execute({ generate_code_coverage_files: 'true' }, {}, testConfig);
|
|
131
|
+
expect(result.script).toContain('--coverage');
|
|
132
|
+
expect(result.script).toContain('lcov.info');
|
|
133
|
+
expect(result.script).toContain('CIBUILD_FLUTTER_COVERAGE_PATH');
|
|
134
|
+
});
|
|
135
|
+
test('should not add coverage flag by default', async () => {
|
|
136
|
+
const executor = new FlutterTestStepExecutor();
|
|
137
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
138
|
+
expect(result.script).not.toContain('--coverage');
|
|
139
|
+
});
|
|
140
|
+
test('should support additional params', async () => {
|
|
141
|
+
const executor = new FlutterTestStepExecutor();
|
|
142
|
+
const result = await executor.execute({ additional_params: '--reporter expanded' }, {}, testConfig);
|
|
143
|
+
expect(result.script).toContain('--reporter expanded');
|
|
144
|
+
});
|
|
145
|
+
test('should support custom project location', async () => {
|
|
146
|
+
const executor = new FlutterTestStepExecutor();
|
|
147
|
+
const result = await executor.execute({ project_location: './packages/core' }, {}, testConfig);
|
|
148
|
+
expect(result.script).toContain('./packages/core');
|
|
149
|
+
});
|
|
150
|
+
test('should run flutter pub get', async () => {
|
|
151
|
+
const executor = new FlutterTestStepExecutor();
|
|
152
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
153
|
+
expect(result.script).toContain('flutter pub get');
|
|
154
|
+
});
|
|
155
|
+
test('should declare outputs', () => {
|
|
156
|
+
const executor = new FlutterTestStepExecutor();
|
|
157
|
+
const outputs = executor.getOutputs();
|
|
158
|
+
expect(outputs).toHaveLength(1);
|
|
159
|
+
expect(outputs[0].name).toBe('CIBUILD_FLUTTER_COVERAGE_PATH');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
describe('GenerateChangelogStepExecutor', () => {
|
|
163
|
+
test('should generate changelog script', async () => {
|
|
164
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
165
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
166
|
+
expect(result.kind).toBe('script');
|
|
167
|
+
expect(result.name).toBe('generate-changelog');
|
|
168
|
+
expect(result.script).toContain('git log');
|
|
169
|
+
});
|
|
170
|
+
test('should find latest tag', async () => {
|
|
171
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
172
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
173
|
+
expect(result.script).toContain('git describe --tags');
|
|
174
|
+
});
|
|
175
|
+
test('should handle no tags', async () => {
|
|
176
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
177
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
178
|
+
expect(result.script).toContain('No tags found');
|
|
179
|
+
});
|
|
180
|
+
test('should ignore merge commits', async () => {
|
|
181
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
182
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
183
|
+
expect(result.script).toContain('--no-merges');
|
|
184
|
+
});
|
|
185
|
+
test('should write changelog to file', async () => {
|
|
186
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
187
|
+
const result = await executor.execute({ changelog_path: './artifacts/CHANGELOG.md' }, {}, testConfig);
|
|
188
|
+
expect(result.script).toContain('./artifacts/CHANGELOG.md');
|
|
189
|
+
});
|
|
190
|
+
test('should export CIBUILD_CHANGELOG', async () => {
|
|
191
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
192
|
+
const result = await executor.execute({}, {}, testConfig);
|
|
193
|
+
expect(result.script).toContain('CIBUILD_CHANGELOG');
|
|
194
|
+
});
|
|
195
|
+
test('should declare outputs', () => {
|
|
196
|
+
const executor = new GenerateChangelogStepExecutor();
|
|
197
|
+
const outputs = executor.getOutputs();
|
|
198
|
+
expect(outputs).toHaveLength(1);
|
|
199
|
+
expect(outputs[0].name).toBe('CIBUILD_CHANGELOG');
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
describe('GithubReleaseStepExecutor', () => {
|
|
203
|
+
test('should require tag input', async () => {
|
|
204
|
+
const executor = new GithubReleaseStepExecutor();
|
|
205
|
+
await expect(executor.execute({}, {}, testConfig)).rejects.toThrow("Missing required input 'tag'");
|
|
206
|
+
});
|
|
207
|
+
test('should generate release script', async () => {
|
|
208
|
+
const executor = new GithubReleaseStepExecutor();
|
|
209
|
+
const result = await executor.execute({ tag: 'v1.0.0' }, {}, testConfig);
|
|
210
|
+
expect(result.kind).toBe('script');
|
|
211
|
+
expect(result.name).toBe('github-release');
|
|
212
|
+
expect(result.script).toContain('gh release create');
|
|
213
|
+
expect(result.script).toContain('v1.0.0');
|
|
214
|
+
});
|
|
215
|
+
test('should support release title', async () => {
|
|
216
|
+
const executor = new GithubReleaseStepExecutor();
|
|
217
|
+
const result = await executor.execute({ tag: 'v1.0.0', name: 'Release 1.0' }, {}, testConfig);
|
|
218
|
+
expect(result.script).toContain('Release 1.0');
|
|
219
|
+
});
|
|
220
|
+
test('should support draft releases', async () => {
|
|
221
|
+
const executor = new GithubReleaseStepExecutor();
|
|
222
|
+
const result = await executor.execute({ tag: 'v1.0.0', draft: 'true' }, {}, testConfig);
|
|
223
|
+
expect(result.script).toContain('--draft');
|
|
224
|
+
});
|
|
225
|
+
test('should support pre-releases', async () => {
|
|
226
|
+
const executor = new GithubReleaseStepExecutor();
|
|
227
|
+
const result = await executor.execute({ tag: 'v1.0.0-beta', pre_release: 'true' }, {}, testConfig);
|
|
228
|
+
expect(result.script).toContain('--prerelease');
|
|
229
|
+
});
|
|
230
|
+
test('should support changelog file as notes', async () => {
|
|
231
|
+
const executor = new GithubReleaseStepExecutor();
|
|
232
|
+
const result = await executor.execute({ tag: 'v1.0.0', changelog_path: './CHANGELOG.md' }, {}, testConfig);
|
|
233
|
+
expect(result.script).toContain('--notes-file');
|
|
234
|
+
expect(result.script).toContain('CHANGELOG.md');
|
|
235
|
+
});
|
|
236
|
+
test('should support file attachments', async () => {
|
|
237
|
+
const executor = new GithubReleaseStepExecutor();
|
|
238
|
+
const result = await executor.execute({ tag: 'v1.0.0', files_to_upload: 'app.apk\napp.ipa' }, {}, testConfig);
|
|
239
|
+
expect(result.script).toContain('FILES_INPUT');
|
|
240
|
+
expect(result.script).toContain('FILE_ARGS');
|
|
241
|
+
});
|
|
242
|
+
test('should generate notes when no body or changelog', async () => {
|
|
243
|
+
const executor = new GithubReleaseStepExecutor();
|
|
244
|
+
const result = await executor.execute({ tag: 'v1.0.0' }, {}, testConfig);
|
|
245
|
+
expect(result.script).toContain('--generate-notes');
|
|
246
|
+
});
|
|
247
|
+
test('should export release URL', async () => {
|
|
248
|
+
const executor = new GithubReleaseStepExecutor();
|
|
249
|
+
const result = await executor.execute({ tag: 'v1.0.0' }, {}, testConfig);
|
|
250
|
+
expect(result.script).toContain('CIBUILD_RELEASE_URL');
|
|
251
|
+
});
|
|
252
|
+
test('should be skipped in local mode', () => {
|
|
253
|
+
const executor = new GithubReleaseStepExecutor();
|
|
254
|
+
expect(executor.isSkippedInLocalMode()).toBe(true);
|
|
255
|
+
});
|
|
256
|
+
test('should declare outputs', () => {
|
|
257
|
+
const executor = new GithubReleaseStepExecutor();
|
|
258
|
+
const outputs = executor.getOutputs();
|
|
259
|
+
expect(outputs).toHaveLength(1);
|
|
260
|
+
expect(outputs[0].name).toBe('CIBUILD_RELEASE_URL');
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
//# sourceMappingURL=phase5.test.js.map
|