Skip to content

Commit feba5f9

Browse files
authored
test: no need to test k8 copy functionality with large file (#174)
Signed-off-by: Lenin Mehedy <[email protected]>
1 parent 1d3dcf4 commit feba5f9

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

test/e2e/core/k8_e2e.test.mjs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ import os from 'os'
2121
import path from 'path'
2222
import { v4 as uuid4 } from 'uuid'
2323
import { FullstackTestingError } from '../../../src/core/errors.mjs'
24-
import { ConfigManager, constants, logging, PackageDownloader, Templates } from '../../../src/core/index.mjs'
24+
import { ConfigManager, constants, logging, Templates } from '../../../src/core/index.mjs'
2525
import { K8 } from '../../../src/core/k8.mjs'
2626

2727
describe('K8', () => {
2828
const testLogger = logging.NewLogger('debug')
2929
const configManager = new ConfigManager(testLogger)
3030
const k8 = new K8(configManager, testLogger)
31-
const downloader = new PackageDownloader(testLogger)
3231

3332
beforeAll(() => {
3433
configManager.load()
@@ -77,20 +76,13 @@ describe('K8', () => {
7776
const podName = Templates.renderNetworkPodName('node0')
7877
const containerName = constants.ROOT_CONTAINER
7978

80-
// attempt fetch platform jar as we need to check if a big zip file can be uploaded/downloaded
81-
const testCacheDir = 'test/data/tmp'
82-
const tag = 'v0.42.5'
83-
const releasePrefix = Templates.prepareReleasePrefix(tag)
84-
const pkgPath = `${testCacheDir}/${releasePrefix}/build-${tag}.zip`
85-
await expect(downloader.fetchPlatform(tag, testCacheDir)).resolves.toBe(pkgPath)
86-
expect(fs.existsSync(pkgPath)).toBeTruthy()
87-
8879
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'k8-'))
8980
const destDir = constants.HEDERA_USER_HOME_DIR
90-
const destPath = `${destDir}/build-${tag}.zip`
81+
const srcPath = 'test/data/pem/keys/a-private-node0.pem'
82+
const destPath = `${destDir}/a-private-node0.pem`
9183

9284
// upload the file
93-
await expect(k8.copyTo(podName, containerName, pkgPath, destDir)).resolves.toBeTruthy()
85+
await expect(k8.copyTo(podName, containerName, srcPath, destDir)).resolves.toBeTruthy()
9486

9587
// download the same file
9688
await expect(k8.copyFrom(podName, containerName, destPath, tmpDir)).resolves.toBeTruthy()
@@ -99,7 +91,7 @@ describe('K8', () => {
9991
await expect(k8.execContainer(podName, containerName, ['rm', '-f', destPath])).resolves
10092

10193
fs.rmdirSync(tmpDir, { recursive: true })
102-
}, 300000)
94+
}, 20000)
10395

10496
it('should be able to port forward gossip port', (done) => {
10597
const podName = Templates.renderNetworkPodName('node0')

0 commit comments

Comments
 (0)