Skip to content

Commit

Permalink
remove test log
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
  • Loading branch information
JeffreyDallas committed Apr 10, 2024
1 parent 84dce0c commit a6199ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/core/dependency_managers/helm_dependency_manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ export class HelmDependencyManager extends ShellRunner {
this.downloader = downloader
this.zippy = zippy
this.installationDir = installationDir
this.osPlatform = osPlatform
this.osArch = ['x64', 'x86-64'].includes(osArch) ? 'amd64' : osArch
// Node.js uses 'win32' for windows in package.json os field, but helm uses 'windows'
if (osPlatform === OS_WIN32) {
this.osPlatform = OS_WINDOWS
} else {
this.osPlatform = osPlatform
}
this.osArch = ['x64', 'x86-64'].includes(osArch) ? 'amd64' : osArch
this.helmVersion = helmVersion
this.helmPath = Templates.installationPath(constants.HELM, this.osPlatform, this.installationDir)

Expand Down
3 changes: 0 additions & 3 deletions src/core/dependency_managers/keytool_dependency_manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,8 @@ export class KeytoolDependencyManager extends ShellRunner {
}

async _fetchKeytoolArtifactUrl () {
console.log('osPlatform', this.osPlatform)
console.log('osArch', this.osArch)
const keytoolRelease = `jdk-${this.javaVersion.major}.${this.javaVersion.minor}.${this.javaVersion.patch}%2B${this.javaVersion.build}`
const adoptiumURL = `https://api.adoptium.net/v3/assets/release_name/eclipse/${keytoolRelease}?architecture=${this.osArch}&heap_size=normal&image_type=jre&os=${this.osPlatform}&project=jdk`
console.log('adoptiumURL', adoptiumURL)
const data = await got.get(adoptiumURL).json()
return data.binaries[0].package
}
Expand Down
6 changes: 0 additions & 6 deletions test/unit/core/key_manager.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,22 @@ describe('KeyManager', () => {
const keytoolDepManager = new KeytoolDependencyManager(downloader, zippy, testLogger)
await keytoolDepManager.checkVersion()
const keytool = new Keytool(testLogger)
logger.showUser('step 1')
for (const nodeId of nodeIds) {
const result = await keyManager.generatePrivatePfxKeys(keytool, nodeId, keysDir, tmpDir)
logger.showUser('nodeId: ' + nodeId)
const expectedPrivatePfx = path.join(keysDir, `private-${nodeId}.pfx`)
expect(result).toStrictEqual(expectedPrivatePfx)
expect(fs.existsSync(expectedPrivatePfx)).toBeTruthy()
const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${expectedPrivatePfx}`)
logger.showUser('output: ' + output)
expect(output.includes('Your keystore contains 3 entries')).toBeTruthy()
}
logger.showUser('step 2')

const result = await keyManager.updatePublicPfxKey(keytool, nodeIds, keysDir, tmpDir)
const expectedPublicPfx = path.join(keysDir, constants.PUBLIC_PFX)
expect(result).toStrictEqual(expectedPublicPfx)
expect(fs.existsSync(expectedPublicPfx)).toBeTruthy()
logger.showUser('stp 3')

const output = await keytool.list(`-storetype pkcs12 -storepass password -keystore ${expectedPublicPfx}`)
expect(output.includes('Your keystore contains 9 entries')).toBeTruthy()
logger.showUser('step 4')

fs.rmSync(keysDir, { recursive: true })
fs.rmSync(tmpDir, { recursive: true })
Expand Down

0 comments on commit a6199ac

Please sign in to comment.