From 6d7522c90b01375d0b9d7d444eb03037b2d4298f Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Mon, 23 Dec 2024 20:14:08 +0000 Subject: [PATCH] npm run format Signed-off-by: Jeromy Cannon --- examples/README.md | 4 +-- src/core/config_manager.ts | 2 +- test/test_util.ts | 2 +- test/unit/commands/base.test.ts | 34 +++++++++--------- test/unit/commands/network.test.ts | 4 +-- test/unit/core/platform_installer.test.ts | 18 +++++----- test/unit/core/profile_manager.test.ts | 43 ++++++++++++----------- 7 files changed, 54 insertions(+), 53 deletions(-) diff --git a/examples/README.md b/examples/README.md index 115753a54..95ee98d8c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,7 +10,7 @@ * make sure that your current kubeconfig context is pointing to the cluster that you want to deploy to * run `task` which will do the rest and deploy the network and take care of many of the pre-requisites -NOTES: +NOTES: * Some of these examples are for running against large clusters with a lot of resources available. * the `env` environment variables if set in your shell will take precedence over what is in the Taskfile.yml. e.g. `export HEDERA_SERVICES_ROOT=` @@ -18,7 +18,7 @@ NOTES: ## Customizing the examples * take a look at the Taskfile.yml sitting in the subdirectory for the deployment you want to run -* make sure your cluster can handle the number in SOLO_NETWORK_SIZE, if not, then you will have to update that and make it match the number of nodes in the `init-containers-values.yaml`: `hedera.nodes[]` +* make sure your cluster can handle the number in SOLO\_NETWORK\_SIZE, if not, then you will have to update that and make it match the number of nodes in the `init-containers-values.yaml`: `hedera.nodes[]` * take a look at the `init-containers-values.yaml` file and make sure the values are correct for your deployment with special attention to: * resources * nodeSelector diff --git a/src/core/config_manager.ts b/src/core/config_manager.ts index 7cbed15cc..85b0a7aee 100644 --- a/src/core/config_manager.ts +++ b/src/core/config_manager.ts @@ -35,7 +35,7 @@ export class ConfigManager { config!: Record; constructor(private readonly logger?: SoloLogger) { - const logger2 = container.resolve(SoloLogger) + const logger2 = container.resolve(SoloLogger); this.reset(); } diff --git a/test/test_util.ts b/test/test_util.ts index 6cdc86b22..54fb1a639 100644 --- a/test/test_util.ts +++ b/test/test_util.ts @@ -61,7 +61,7 @@ import {HEDERA_PLATFORM_VERSION} from '../version.js'; import {IntervalLeaseRenewalService} from '../src/core/lease/interval_lease_renewal.js'; import {Duration} from '../src/core/time/duration.js'; import {container} from 'tsyringe-neo'; -import {resetTestContainer} from "./test_container.js"; +import {resetTestContainer} from './test_container.js'; export const testLogger = logging.NewLogger('debug', true); export const TEST_CLUSTER = 'solo-e2e'; diff --git a/test/unit/commands/base.test.ts b/test/unit/commands/base.test.ts index 589154483..d25bd6adf 100644 --- a/test/unit/commands/base.test.ts +++ b/test/unit/commands/base.test.ts @@ -28,16 +28,16 @@ import {BaseCommand} from '../../../src/commands/base.js'; import {Flags as flags} from '../../../src/commands/flags.js'; import sinon from 'sinon'; import {container} from 'tsyringe-neo'; -import {SoloLogger} from "../../../src/core/logging.js"; -import {resetTestContainer} from "../../test_container.js"; +import {SoloLogger} from '../../../src/core/logging.js'; +import {resetTestContainer} from '../../test_container.js'; describe.only('BaseCommand', () => { - let helm: Helm; - let chartManager: ChartManager; - let configManager: ConfigManager; - let depManager: DependencyManager; - let localConfig: LocalConfig; - let remoteConfigManager: RemoteConfigManager; + let helm: Helm; + let chartManager: ChartManager; + let configManager: ConfigManager; + let depManager: DependencyManager; + let localConfig: LocalConfig; + let remoteConfigManager: RemoteConfigManager; let sandbox = sinon.createSandbox(); let testLogger: SoloLogger; @@ -45,16 +45,16 @@ describe.only('BaseCommand', () => { describe('runShell', () => { before(() => { - // resetTestContainer(); - testLogger = container.resolve(SoloLogger); - helm = container.resolve(Helm); - chartManager = container.resolve(ChartManager); - configManager = container.resolve(ConfigManager); - depManager = container.resolve(DependencyManager); - localConfig = container.resolve(LocalConfig); - remoteConfigManager = container.resolve(RemoteConfigManager); + // resetTestContainer(); + testLogger = container.resolve(SoloLogger); + helm = container.resolve(Helm); + chartManager = container.resolve(ChartManager); + configManager = container.resolve(ConfigManager); + depManager = container.resolve(DependencyManager); + localConfig = container.resolve(LocalConfig); + remoteConfigManager = container.resolve(RemoteConfigManager); - sandbox = sinon.createSandbox(); + sandbox = sinon.createSandbox(); sandbox.stub(K8.prototype, 'init').callsFake(() => this); const k8 = container.resolve(K8); diff --git a/test/unit/commands/network.test.ts b/test/unit/commands/network.test.ts index 20463f53c..de1cb7c8d 100644 --- a/test/unit/commands/network.test.ts +++ b/test/unit/commands/network.test.ts @@ -74,8 +74,8 @@ describe('NetworkCommand unit tests', () => { let bootstrapResp: any; before(() => { - bootstrapResp = bootstrapTestVariables(testName, argv); - }) + bootstrapResp = bootstrapTestVariables(testName, argv); + }); beforeEach(() => { opts = getBaseCommandOpts(); diff --git a/test/unit/core/platform_installer.test.ts b/test/unit/core/platform_installer.test.ts index 720116b48..849d15b95 100644 --- a/test/unit/core/platform_installer.test.ts +++ b/test/unit/core/platform_installer.test.ts @@ -28,17 +28,17 @@ import {IllegalArgumentError, MissingArgumentError} from '../../../src/core/erro import {getK8Instance} from '../../test_util.js'; import type {PodName} from '../../../src/types/aliases.js'; import {container} from 'tsyringe-neo'; -import {K8} from "../../../src/core/k8.js"; -import {SoloLogger} from "../../../src/core/logging.js"; +import {K8} from '../../../src/core/k8.js'; +import {SoloLogger} from '../../../src/core/logging.js'; describe('PackageInstaller', () => { - let testLogger: SoloLogger, configManager: ConfigManager, k8: K8, installer: PlatformInstaller; - before(() => { - testLogger = logging.NewLogger('debug', true); - configManager = container.resolve(ConfigManager); - k8 = getK8Instance(configManager); - installer = container.resolve(PlatformInstaller); - }) + let testLogger: SoloLogger, configManager: ConfigManager, k8: K8, installer: PlatformInstaller; + before(() => { + testLogger = logging.NewLogger('debug', true); + configManager = container.resolve(ConfigManager); + k8 = getK8Instance(configManager); + installer = container.resolve(PlatformInstaller); + }); describe('validatePlatformReleaseDir', () => { it('should fail for missing path', () => { diff --git a/test/unit/core/profile_manager.test.ts b/test/unit/core/profile_manager.test.ts index 961836487..1104f212f 100644 --- a/test/unit/core/profile_manager.test.ts +++ b/test/unit/core/profile_manager.test.ts @@ -24,32 +24,33 @@ import {Flags as flags} from '../../../src/commands/flags.js'; import * as constants from '../../../src/core/constants.js'; import {ConfigManager} from '../../../src/core/config_manager.js'; import {ProfileManager} from '../../../src/core/profile_manager.js'; -import {getTestCacheDir, getTmpDir, testLogger} from '../../test_util.js'; +import {getTestCacheDir, getTmpDir} from '../../test_util.js'; import * as version from '../../../version.js'; import type {NodeAlias} from '../../../src/types/aliases.js'; import {container} from 'tsyringe-neo'; - - describe('ProfileManager', () => { - let tmpDir: string, configManager: ConfigManager, profileManager: ProfileManager, testProfileFile: string, - cacheDir: string; - - before(() => { - tmpDir = getTmpDir(); - configManager = container.resolve(ConfigManager); - profileManager = new ProfileManager(tmpDir); - configManager.setFlag(flags.nodeAliasesUnparsed, 'node1,node2,node4'); - testProfileFile = path.join('test', 'data', 'test-profiles.yaml'); - configManager.setFlag(flags.cacheDir, getTestCacheDir('ProfileManager')); - configManager.setFlag(flags.releaseTag, version.HEDERA_PLATFORM_VERSION); - cacheDir = configManager.getFlag(flags.cacheDir) as string; - configManager.setFlag(flags.apiPermissionProperties, path.join(cacheDir, 'templates', 'api-permission.properties')); - configManager.setFlag(flags.applicationProperties, path.join(cacheDir, 'templates', 'application.properties')); - configManager.setFlag(flags.bootstrapProperties, path.join(cacheDir, 'templates', 'bootstrap.properties')); - configManager.setFlag(flags.log4j2Xml, path.join(cacheDir, 'templates', 'log4j2.xml')); - configManager.setFlag(flags.settingTxt, path.join(cacheDir, 'templates', 'settings.txt')); - }); + let tmpDir: string, + configManager: ConfigManager, + profileManager: ProfileManager, + testProfileFile: string, + cacheDir: string; + + before(() => { + tmpDir = getTmpDir(); + configManager = container.resolve(ConfigManager); + profileManager = new ProfileManager(tmpDir); + configManager.setFlag(flags.nodeAliasesUnparsed, 'node1,node2,node4'); + testProfileFile = path.join('test', 'data', 'test-profiles.yaml'); + configManager.setFlag(flags.cacheDir, getTestCacheDir('ProfileManager')); + configManager.setFlag(flags.releaseTag, version.HEDERA_PLATFORM_VERSION); + cacheDir = configManager.getFlag(flags.cacheDir) as string; + configManager.setFlag(flags.apiPermissionProperties, path.join(cacheDir, 'templates', 'api-permission.properties')); + configManager.setFlag(flags.applicationProperties, path.join(cacheDir, 'templates', 'application.properties')); + configManager.setFlag(flags.bootstrapProperties, path.join(cacheDir, 'templates', 'bootstrap.properties')); + configManager.setFlag(flags.log4j2Xml, path.join(cacheDir, 'templates', 'log4j2.xml')); + configManager.setFlag(flags.settingTxt, path.join(cacheDir, 'templates', 'settings.txt')); + }); after(() => { fs.rmSync(tmpDir, {recursive: true});