Skip to content

Commit ec3fc91

Browse files
committed
fixed tests, altered used/unused command options
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 3e1791d commit ec3fc91

File tree

4 files changed

+18
-42
lines changed

4 files changed

+18
-42
lines changed

src/commands/network.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ export class NetworkCommand extends BaseCommand {
4040
static get DEPLOY_FLAGS_LIST () {
4141
return [
4242
flags.apiPermissionProperties,
43+
flags.app,
4344
flags.applicationEnv,
4445
flags.applicationProperties,
4546
flags.bootstrapProperties,
47+
flags.chainId,
4648
flags.chartDirectory,
4749
flags.deployHederaExplorer,
4850
flags.deployMirrorNode,
@@ -133,9 +135,11 @@ export class NetworkCommand extends BaseCommand {
133135
// disable the prompts that we don't want to prompt the user for
134136
prompts.disablePrompts([
135137
flags.apiPermissionProperties,
138+
flags.app,
136139
flags.applicationEnv,
137140
flags.applicationProperties,
138141
flags.bootstrapProperties,
142+
flags.chainId,
139143
flags.deployHederaExplorer,
140144
flags.deployMirrorNode,
141145
flags.hederaExplorerTlsLoadBalancerIp,

src/commands/node.mjs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ export class NodeCommand extends BaseCommand {
6363

6464
static get SETUP_FLAGS_LIST () {
6565
return [
66-
flags.app,
6766
flags.appConfig,
6867
flags.cacheDir,
69-
flags.chainId,
7068
flags.devMode,
7169
flags.force,
7270
flags.generateGossipKeys,
@@ -100,7 +98,6 @@ export class NodeCommand extends BaseCommand {
10098

10199
static get REFRESH_FLAGS_LIST () {
102100
return [
103-
flags.app,
104101
flags.cacheDir,
105102
flags.devMode,
106103
flags.force,
@@ -117,6 +114,7 @@ export class NodeCommand extends BaseCommand {
117114

118115
static get ADD_FLAGS_LIST () {
119116
return [
117+
flags.app,
120118
flags.cacheDir,
121119
flags.chainId,
122120
flags.chartDirectory,
@@ -412,7 +410,6 @@ export class NodeCommand extends BaseCommand {
412410

413411
async initializeSetup (config, configManager, k8) {
414412
// compute other config parameters
415-
config.releasePrefix = Templates.prepareReleasePrefix(config.releaseTag)
416413
config.keysDir = path.join(validatePath(config.cacheDir), 'keys')
417414
config.stagingDir = Templates.renderStagingDir(
418415
configManager.getFlag(flags.cacheDir),
@@ -518,7 +515,6 @@ export class NodeCommand extends BaseCommand {
518515

519516
// disable the prompts that we don't want to prompt the user for
520517
prompts.disablePrompts([
521-
flags.app,
522518
flags.appConfig,
523519
flags.devMode,
524520
flags.force,
@@ -533,7 +529,6 @@ export class NodeCommand extends BaseCommand {
533529
* @property {string} app
534530
* @property {string} appConfig
535531
* @property {string} cacheDir
536-
* @property {string} chainId
537532
* @property {boolean} devMode
538533
* @property {boolean} force
539534
* @property {boolean} generateGossipKeys
@@ -548,7 +543,6 @@ export class NodeCommand extends BaseCommand {
548543
* @property {string} keysDir
549544
* @property {string[]} nodeIds
550545
* @property {string[]} podNames
551-
* @property {string} releasePrefix
552546
* @property {string} stagingDir
553547
* @property {string} stagingKeysDir
554548
* -- methods --
@@ -566,7 +560,6 @@ export class NodeCommand extends BaseCommand {
566560
'keysDir',
567561
'nodeIds',
568562
'podNames',
569-
'releasePrefix',
570563
'stagingDir',
571564
'stagingKeysDir'
572565
])
@@ -805,7 +798,7 @@ export class NodeCommand extends BaseCommand {
805798
}
806799
})
807800
},
808-
skip: (ctx, _) => self.configManager.getFlag(flags.app) !== ''
801+
skip: (ctx, _) => self.configManager.getFlag(flags.app) !== '' && self.configManager.getFlag(flags.app) !== constants.HEDERA_APP_NAME
809802
}], {
810803
concurrent: false,
811804
rendererOptions: constants.LISTR_DEFAULT_RENDERER_OPTION
@@ -1003,7 +996,6 @@ export class NodeCommand extends BaseCommand {
1003996
self.configManager.update(argv)
1004997
// disable the prompts that we don't want to prompt the user for
1005998
prompts.disablePrompts([
1006-
flags.app,
1007999
flags.devMode,
10081000
flags.force
10091001
])
@@ -1013,7 +1005,6 @@ export class NodeCommand extends BaseCommand {
10131005
/**
10141006
* @typedef {Object} NodeRefreshConfigClass
10151007
* -- flags --
1016-
* @property {string} app
10171008
* @property {string} cacheDir
10181009
* @property {boolean} devMode
10191010
* @property {boolean} force
@@ -1025,7 +1016,6 @@ export class NodeCommand extends BaseCommand {
10251016
* @property {string} keysDir
10261017
* @property {string[]} nodeIds
10271018
* @property {Object} podNames
1028-
* @property {string} releasePrefix
10291019
* @property {string} stagingDir
10301020
* @property {string} stagingKeysDir
10311021
* -- methods --
@@ -1042,7 +1032,6 @@ export class NodeCommand extends BaseCommand {
10421032
'keysDir',
10431033
'nodeIds',
10441034
'podNames',
1045-
'releasePrefix',
10461035
'stagingDir',
10471036
'stagingKeysDir'
10481037
])
@@ -1258,6 +1247,8 @@ export class NodeCommand extends BaseCommand {
12581247

12591248
// disable the prompts that we don't want to prompt the user for
12601249
prompts.disablePrompts([
1250+
flags.app,
1251+
flags.chainId,
12611252
flags.chartDirectory,
12621253
flags.devMode,
12631254
flags.force,
@@ -1269,6 +1260,7 @@ export class NodeCommand extends BaseCommand {
12691260
/**
12701261
* @typedef {Object} NodeAddConfigClass
12711262
* -- flags --
1263+
* @property {string} app
12721264
* @property {string} cacheDir
12731265
* @property {string} chainId
12741266
* @property {string} chartDirectory
@@ -1288,7 +1280,6 @@ export class NodeCommand extends BaseCommand {
12881280
* @property {string} keysDir
12891281
* @property {string[]} nodeIds
12901282
* @property {Object} podNames
1291-
* @property {string} releasePrefix
12921283
* @property {Map<String, NetworkNodeServices>} serviceMap
12931284
* @property {string} stagingDir
12941285
* @property {string} stagingKeysDir
@@ -1309,7 +1300,6 @@ export class NodeCommand extends BaseCommand {
13091300
'keysDir',
13101301
'nodeIds',
13111302
'podNames',
1312-
'releasePrefix',
13131303
'serviceMap',
13141304
'stagingDir',
13151305
'stagingKeysDir'
@@ -1747,6 +1737,7 @@ export class NodeCommand extends BaseCommand {
17471737
command: 'start',
17481738
desc: 'Start a node',
17491739
builder: y => flags.setCommandFlags(y,
1740+
flags.app,
17501741
flags.namespace,
17511742
flags.nodeIDs
17521743
),

test/e2e/core/platform_installer_e2e.test.mjs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,33 +80,6 @@ describe('PackageInstallerE2E', () => {
8080
}, 60000)
8181
})
8282

83-
describe('prepareConfigTxt', () => {
84-
it('should succeed in generating config.txt', async () => {
85-
const tmpDir = getTmpDir()
86-
const configPath = `${tmpDir}/config.txt`
87-
const nodeIDs = ['node0']
88-
const chainId = '299'
89-
90-
const configLines = await installer.prepareConfigTxt(nodeIDs, configPath, packageVersion, chainId)
91-
92-
// verify format is correct
93-
expect(configLines.length).toBe(4)
94-
expect(configLines[0]).toBe(`swirld, ${chainId}`)
95-
expect(configLines[1]).toBe(`app, ${constants.HEDERA_APP_NAME}`)
96-
expect(configLines[2]).toContain('address, 0, node0, node0, 1')
97-
expect(configLines[3]).toBe('nextNodeId, 1')
98-
99-
// verify the file exists
100-
expect(fs.existsSync(configPath)).toBeTruthy()
101-
const fileContents = fs.readFileSync(configPath).toString()
102-
103-
// verify file content matches
104-
expect(fileContents).toBe(configLines.join('\n'))
105-
106-
fs.rmSync(tmpDir, { recursive: true })
107-
}, defaultTimeout)
108-
})
109-
11083
describe('copyGossipKeys', () => {
11184
it('should succeed to copy legacy pfx gossip keys for node0', async () => {
11285
const podName = 'network-node0-0'

test/test_util.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,20 @@ export function bootstrapNetwork (testName, argv,
209209
await networkCmd.deploy(argv)
210210

211211
expect(networkCmd.getUnusedConfigs(NetworkCommand.DEPLOY_CONFIGS_NAME)).toEqual([
212+
flags.apiPermissionProperties.constName,
213+
flags.app.constName,
214+
flags.applicationEnv.constName,
215+
flags.applicationProperties.constName,
216+
flags.bootstrapProperties.constName,
217+
flags.chainId.constName,
212218
flags.deployHederaExplorer.constName,
213219
flags.deployMirrorNode.constName,
214220
flags.hederaExplorerTlsHostName.constName,
215221
flags.hederaExplorerTlsLoadBalancerIp.constName,
222+
flags.log4j2Xml.constName,
216223
flags.profileFile.constName,
217224
flags.profileName.constName,
225+
flags.settingTxt.constName,
218226
flags.tlsClusterIssuerType.constName
219227
])
220228
}, 180000)

0 commit comments

Comments
 (0)