Skip to content

Commit bcd6666

Browse files
leninmehedyjeromy-cannon
authored andcommitted
fix: do not use solo version for fst-chart-version by default (#67)
Signed-off-by: Lenin Mehedy <[email protected]>
1 parent 52082fd commit bcd6666

File tree

12 files changed

+66
-35
lines changed

12 files changed

+66
-35
lines changed

.github/workflows/zxc-compile-code.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,6 @@ jobs:
7070
- name: Checkout Code
7171
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7272

73-
- name: Checkout Helm Charts
74-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
75-
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
76-
with:
77-
repository: hashgraph/full-stack-testing
78-
sparse-checkout: charts
79-
path: helm-charts
80-
8173
- name: Setup Node
8274
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
8375
with:
@@ -138,10 +130,6 @@ jobs:
138130
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
139131
run: docker image pull kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
140132

141-
- name: Stage Helm Charts
142-
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
143-
run: mv -vf helm-charts/charts/ ./ && rm -rf helm-charts
144-
145133
- name: Setup E2E Tests
146134
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
147135
run: |

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,23 @@ kubectx <context-name>
6565
* In this case, ensure your Docker engine has enough resources (e.g. Memory >=8Gb, CPU: >=4).
6666

6767
First, use the following command to set up the environment variables:
68+
6869
```
6970
export SOLO_CLUSTER_NAME=solo
7071
export SOLO_NAMESPACE=solo
7172
export SOLO_CLUSTER_SETUP_NAMESPACE=solo-cluster
7273
```
7374

7475
Then run the following command to set the kubectl context to the new cluster:
76+
7577
```
7678
kind create cluster -n "${SOLO_CLUSTER_NAME}"
7779
kubectl create ns "${SOLO_NAMESPACE}"
7880
kubectl create ns "${SOLO_CLUSTER_SETUP_NAMESPACE}"
7981
```
8082

8183
and the command output should look like this:
84+
8285
```
8386
Creating cluster "solo" ...
8487
✓ Ensuring node image (kindest/node:v1.27.3) 🖼

src/commands/cluster.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export class ClusterCommand extends BaseCommand {
7373
await prompts.execute(task, self.configManager, [
7474
flags.clusterSetupNamespace,
7575
flags.chartDirectory,
76-
flags.fstChartVersion,
7776
flags.deployPrometheusStack,
7877
flags.deployMinio,
7978
flags.deployCertManager,

src/commands/flags.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
import { constants } from '../core/index.mjs'
1818
import * as core from '../core/index.mjs'
19-
import * as helpers from '../core/helpers.mjs'
2019

2120
/**
2221
* Set flag from the flag option
@@ -329,7 +328,7 @@ export const fstChartVersion = {
329328
name: 'fst-chart-version',
330329
definition: {
331330
describe: 'Fullstack testing chart version',
332-
defaultValue: helpers.packageVersion(),
331+
defaultValue: '',
333332
type: 'string'
334333
}
335334
}

src/commands/init.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ export class InitCommand extends BaseCommand {
159159
flags.clusterSetupNamespace,
160160
flags.cacheDir,
161161
flags.chartDirectory,
162-
flags.keyFormat
162+
flags.keyFormat,
163+
flags.fstChartVersion
163164
)
164165
},
165166
handler: (argv) => {

src/commands/network.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export class NetworkCommand extends BaseCommand {
110110
flags.namespace,
111111
flags.nodeIDs,
112112
flags.chartDirectory,
113-
flags.fstChartVersion,
114113
flags.valuesFile,
115114
flags.deployMirrorNode,
116115
flags.deployHederaExplorer,

src/commands/node.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ export class NodeCommand extends BaseCommand {
420420
await prompts.execute(task, self.configManager, [
421421
flags.namespace,
422422
flags.chartDirectory,
423-
flags.fstChartVersion,
424423
flags.nodeIDs,
425424
flags.deployHederaExplorer,
426425
flags.deployMirrorNode,
@@ -517,6 +516,16 @@ export class NodeCommand extends BaseCommand {
517516
ctx.config.valuesArg
518517
)
519518
}
519+
},
520+
{
521+
title: 'Waiting for explorer pod to be ready',
522+
task: async (ctx, _) => {
523+
if (ctx.config.deployHederaExplorer) {
524+
await this.k8.waitForPod(constants.POD_STATUS_RUNNING, [
525+
'app.kubernetes.io/component=hedera-explorer', 'app.kubernetes.io/name=hedera-explorer'
526+
], 1, 100)
527+
}
528+
}
520529
}
521530
]
522531

@@ -536,17 +545,8 @@ export class NodeCommand extends BaseCommand {
536545
'skipping special account keys update, special accounts will retain genesis private keys'))
537546
}
538547
}
539-
},
540-
{
541-
title: 'Waiting for explorer pod to be ready',
542-
task: async (ctx, _) => {
543-
if (ctx.config.deployHederaExplorer) {
544-
await this.k8.waitForPod(constants.POD_STATUS_RUNNING, [
545-
'app.kubernetes.io/component=hedera-explorer', 'app.kubernetes.io/name=hedera-explorer'
546-
], 1)
547-
}
548-
}
549-
}], {
548+
}
549+
], {
550550
concurrent: false,
551551
rendererOptions: constants.LISTR_DEFAULT_RENDERER_OPTION
552552
})

test/e2e/commands/01_node.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ describe.each([
9494
argv[flags.keyFormat.name] = testKeyFormat
9595
argv[flags.nodeIDs.name] = 'node0,node1,node2'
9696
argv[flags.cacheDir.name] = cacheDir
97-
argv[flags.chartDirectory.name] = './charts'
9897
argv[flags.force.name] = false
9998
argv[flags.chainId.name] = constants.HEDERA_CHAIN_ID
10099
argv[flags.generateGossipKeys.name] = false

test/e2e/core/chart_manager.test.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright (C) 2024 Hedera Hashgraph, LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the ""License"");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an ""AS IS"" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
import { beforeAll, describe, expect, it } from '@jest/globals'
18+
import { flags } from '../../../src/commands/index.mjs'
19+
import { ChartManager, ConfigManager, Helm, constants } from '../../../src/core/index.mjs'
20+
import { testLogger } from '../../test_util.js'
21+
22+
describe('ChartManager', () => {
23+
const helm = new Helm(testLogger)
24+
const chartManager = new ChartManager(helm, testLogger)
25+
const configManager = new ConfigManager(testLogger)
26+
27+
beforeAll(() => {
28+
configManager.load()
29+
})
30+
31+
it('should be able to list installed charts', async () => {
32+
const ns = configManager.getFlag(flags.namespace)
33+
expect(ns).not.toBeNull()
34+
const list = await chartManager.getInstalledCharts(ns)
35+
expect(list.length).not.toBe(0)
36+
})
37+
38+
it('should be able to check if a chart is installed', async () => {
39+
const ns = configManager.getFlag(flags.clusterSetupNamespace)
40+
expect(ns).not.toBeNull()
41+
const isInstalled = await chartManager.isChartInstalled(ns, constants.FULLSTACK_CLUSTER_SETUP_CHART)
42+
expect(isInstalled).toBeTruthy()
43+
})
44+
})

test/e2e/core/k8_e2e.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ describe('K8', () => {
152152
fs.rmdirSync(tmpDir, { recursive: true })
153153
})
154154

155-
it('should be able to get two persistent volume claims', async () => {
155+
it('should be able to list persistent volume claims', async () => {
156156
const pvcs = await k8.listPvcsByNamespace(k8._getNamespace())
157-
expect(pvcs).toHaveLength(2)
157+
expect(pvcs.length).toBeGreaterThan(0)
158158
})
159159
})

test/e2e/setup-e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ kind delete cluster -n "${SOLO_CLUSTER_NAME}" || true
88
kind create cluster -n "${SOLO_CLUSTER_NAME}" --image "${KIND_IMAGE}" || exit 1
99
kubectl create ns "${SOLO_NAMESPACE}" || exit 1
1010
kubectl create ns "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1
11-
solo init --namespace "${SOLO_NAMESPACE}" -d ./charts -i node0,node1,node2 -t v0.42.5 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1 # cache args for subsequent commands
11+
solo init --namespace "${SOLO_NAMESPACE}" -i node0,node1,node2 -t v0.42.5 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1 # cache args for subsequent commands
1212
solo cluster setup || exit 1
1313
solo network deploy || exit 1

test/unit/core/dependency_manager.test.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
*
1616
*/
1717
import { describe, expect, it } from '@jest/globals'
18-
import { DependencyManager } from '../../../src/core/dependency_manager.mjs'
18+
import { DependencyManager, logging, constants } from '../../../src/core/index.mjs'
1919
import { FullstackTestingError } from '../../../src/core/errors.mjs'
20-
import { logging, constants } from '../../../src/core/index.mjs'
2120

2221
const testLogger = logging.NewLogger('debug')
2322
describe('DependencyManager', () => {

0 commit comments

Comments
 (0)