Skip to content

Commit

Permalink
npm run format
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon committed Dec 23, 2024
1 parent f323ca7 commit 6d7522c
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 53 deletions.
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* 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=<path-to-hedera-services-root>`

## 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
Expand Down
2 changes: 1 addition & 1 deletion src/core/config_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ConfigManager {
config!: Record<string, any>;

constructor(private readonly logger?: SoloLogger) {
const logger2 = container.resolve(SoloLogger)
const logger2 = container.resolve(SoloLogger);
this.reset();
}

Expand Down
2 changes: 1 addition & 1 deletion test/test_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
34 changes: 17 additions & 17 deletions test/unit/commands/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ 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;

let baseCmd: 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);

Expand Down
4 changes: 2 additions & 2 deletions test/unit/commands/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('NetworkCommand unit tests', () => {
let bootstrapResp: any;

before(() => {
bootstrapResp = bootstrapTestVariables(testName, argv);
})
bootstrapResp = bootstrapTestVariables(testName, argv);
});

beforeEach(() => {
opts = getBaseCommandOpts();
Expand Down
18 changes: 9 additions & 9 deletions test/unit/core/platform_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
43 changes: 22 additions & 21 deletions test/unit/core/profile_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(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<string>(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});
Expand Down

0 comments on commit 6d7522c

Please sign in to comment.