Skip to content

Commit 7d96536

Browse files
Merge branch 'main' into 00096-node-refresh
2 parents 374e82e + 2a66fe9 commit 7d96536

File tree

2 files changed

+92
-13
lines changed

2 files changed

+92
-13
lines changed

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ jobs:
7676
node-version: ${{ inputs.node-version }}
7777
cache: npm
7878

79-
- name: Setup Java
80-
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
81-
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
82-
with:
83-
distribution: temurin
84-
java-version: 21
85-
8679
- name: Setup Kind
8780
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
8881
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
@@ -94,12 +87,6 @@ jobs:
9487
verbosity: 3
9588
wait: 120s
9689

97-
- name: Setup Helm
98-
uses: azure/setup-helm@29960d0f5f19214b88e1d9ba750a9914ab0f1a2f # v4.0.0
99-
if: ${{ (inputs.enable-unit-tests || inputs.enable-e2e-tests) && !cancelled() && !failure() }}
100-
with:
101-
version: "v3.12.3" # helm version
102-
10390
- name: Install Dependencies
10491
id: npm-deps
10592
run: npm ci

test/e2e/commands/relay.test.mjs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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+
18+
import {
19+
afterAll, afterEach, describe,
20+
expect,
21+
it
22+
} from '@jest/globals'
23+
import { flags } from '../../../src/commands/index.mjs'
24+
import {
25+
constants
26+
} from '../../../src/core/index.mjs'
27+
import {
28+
bootstrapNetwork,
29+
getDefaultArgv,
30+
TEST_CLUSTER
31+
} from '../../test_util.js'
32+
import * as version from '../../../version.mjs'
33+
import { sleep } from '../../../src/core/helpers.mjs'
34+
import { RelayCommand } from '../../../src/commands/relay.mjs'
35+
36+
describe('RelayCommand', () => {
37+
const testName = 'relay-cmd-e2e'
38+
const namespace = testName
39+
const argv = getDefaultArgv()
40+
argv[flags.namespace.name] = namespace
41+
argv[flags.releaseTag.name] = 'v0.47.0-alpha.0'
42+
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM
43+
44+
argv[flags.nodeIDs.name] = 'node0,node1,node2'
45+
argv[flags.generateGossipKeys.name] = true
46+
argv[flags.generateTlsKeys.name] = true
47+
argv[flags.clusterName.name] = TEST_CLUSTER
48+
argv[flags.fstChartVersion.name] = version.FST_CHART_VERSION
49+
argv[flags.force.name] = true
50+
argv[flags.relayReleaseTag.name] = flags.relayReleaseTag.definition.defaultValue
51+
52+
const bootstrapResp = bootstrapNetwork(testName, argv)
53+
const k8 = bootstrapResp.opts.k8
54+
const configManager = bootstrapResp.opts.configManager
55+
const relayCmd = new RelayCommand(bootstrapResp.opts)
56+
57+
afterAll(async () => {
58+
await k8.deleteNamespace(namespace)
59+
})
60+
61+
afterEach(async () => {
62+
await sleep(5) // give a few ticks so that connections can close
63+
})
64+
65+
it.each([
66+
{ relayNodes: 'node0' },
67+
{ relayNodes: 'node0,node1' },
68+
{ relayNodes: 'node0,node1,node2' }
69+
])('relay deploy and destroy should work with different number of relay nodes', async (input) => {
70+
argv[flags.nodeIDs.name] = input.relayNodes
71+
configManager.update(argv)
72+
expect.assertions(2)
73+
74+
// test relay deploy
75+
try {
76+
await expect(relayCmd.deploy(argv)).resolves.toBeTruthy()
77+
} catch (e) {
78+
relayCmd.logger.showUserError(e)
79+
expect(e).toBeNull()
80+
}
81+
82+
await sleep(500)
83+
84+
// test relay destroy
85+
try {
86+
await expect(relayCmd.destroy(argv)).resolves.toBeTruthy()
87+
} catch (e) {
88+
relayCmd.logger.showUserError(e)
89+
expect(e).toBeNull()
90+
}
91+
}, 60000)
92+
})

0 commit comments

Comments
 (0)