diff --git a/apps/package-manager/packages/generic/src/packageManager.ts b/apps/package-manager/packages/generic/src/packageManager.ts index 7701705d..568e8403 100644 --- a/apps/package-manager/packages/generic/src/packageManager.ts +++ b/apps/package-manager/packages/generic/src/packageManager.ts @@ -511,7 +511,7 @@ class ExpectationManagerCallbacksHandler implements ExpectationManagerCallbacks public reportExpectationStatus( expectationId: ExpectationId, - expectaction: Expectation.Any | null, + expectation: Expectation.Any | null, actualVersionHash: string | null, statusInfo: { status?: ExpectedPackageStatusAPI.WorkStatusState @@ -521,17 +521,17 @@ class ExpectationManagerCallbacksHandler implements ExpectationManagerCallbacks prevStatusReasons?: { [state: string]: Reason } } ): void { - if (!expectaction) { + if (!expectation) { if (this.toReportExpectationStatuses.has(expectationId)) { this.updateExpectationStatus(expectationId, null) } } else { - if (!expectaction.statusReport.sendReport) return // Don't report the status + if (!expectation.statusReport.sendReport) return // Don't report the status const previouslyReported = this.toReportExpectationStatuses.get(expectationId)?.status // Remove undefined properties, so they don't mess with the spread operators below: - deleteAllUndefinedProperties(expectaction.statusReport) + deleteAllUndefinedProperties(expectation.statusReport) deleteAllUndefinedProperties(statusInfo) const workStatus: ExpectedPackageStatusAPI.WorkStatus = { @@ -548,10 +548,10 @@ class ExpectationManagerCallbacksHandler implements ExpectationManagerCallbacks ...((previouslyReported || {}) as Partial), // Intentionally cast to Partial<>, to make typings in const workStatus more strict // Updated properties: - ...expectaction.statusReport, + ...expectation.statusReport, ...statusInfo, - fromPackages: expectaction.fromPackages.map((fromPackage) => { + fromPackages: expectation.fromPackages.map((fromPackage) => { const fromPackageId = unprotectString(fromPackage.id) const prevPromPackage = this.toReportExpectationStatuses .get(expectationId) diff --git a/shared/packages/expectationManager/src/expectationManager.ts b/shared/packages/expectationManager/src/expectationManager.ts index 32b1249d..e4a2d538 100644 --- a/shared/packages/expectationManager/src/expectationManager.ts +++ b/shared/packages/expectationManager/src/expectationManager.ts @@ -163,7 +163,7 @@ export type MessageFromWorker = (message: ExpectationManagerWorkerAgent.MessageF export interface ExpectationManagerCallbacks { reportExpectationStatus: ( expectationId: ExpectationId, - expectaction: Expectation.Any | null, + expectation: Expectation.Any | null, actualVersionHash: string | null, statusInfo: { status?: ExpectedPackageStatusAPI.WorkStatusState diff --git a/shared/packages/expectationManager/src/expectationTracker/expectationTracker.ts b/shared/packages/expectationManager/src/expectationTracker/expectationTracker.ts index 91aad591..cfbc8964 100644 --- a/shared/packages/expectationManager/src/expectationTracker/expectationTracker.ts +++ b/shared/packages/expectationManager/src/expectationTracker/expectationTracker.ts @@ -23,7 +23,7 @@ import { TrackedPackageContainerAPI } from './lib/trackedPackageContainerAPI' import { TrackedPackageContainerPackageAPI } from './lib/trackedPackageContainerPackageAPI' /** - * The ExpectationTracker is responsible for tracking and uptating the state of the Expectations + * The ExpectationTracker is responsible for tracking and updating the state of the Expectations */ export class ExpectationTracker extends HelpfulEventEmitter { public constants: ExpectationTrackerConstants @@ -93,9 +93,9 @@ export class ExpectationTracker extends HelpfulEventEmitter { public getFulfilledWaitTime(): number { return ( // Default minimum time to wait: - this.constants.FULLFILLED_MONITOR_TIME + + this.constants.FULFILLED_MONITOR_TIME + // Also add some more time, so that we don't check too often when we have a lot of expectations: - this.constants.FULLFILLED_MONITOR_TIME_ADD_PER_EXPECTATION * this.trackedExpectations.getIds().length + this.constants.FULFILLED_MONITOR_TIME_ADD_PER_EXPECTATION * this.trackedExpectations.getIds().length ) } /** Called when there is a monitor-status-update from a worker */ diff --git a/shared/packages/expectationManager/src/lib/constants.ts b/shared/packages/expectationManager/src/lib/constants.ts index 2ac60ff6..4fec3388 100644 --- a/shared/packages/expectationManager/src/lib/constants.ts +++ b/shared/packages/expectationManager/src/lib/constants.ts @@ -2,9 +2,9 @@ export interface ExpectationTrackerConstants { /** Time between iterations of the expectation queue [ms] */ EVALUATE_INTERVAL: number /** Minimum time between re-evaluating fulfilled expectations [ms] */ - FULLFILLED_MONITOR_TIME: number - /** Added to FULLFILLED_MONITOR_TIME, a time-per-expectation [ms] */ - FULLFILLED_MONITOR_TIME_ADD_PER_EXPECTATION: number + FULFILLED_MONITOR_TIME: number + /** Added to FULFILLED_MONITOR_TIME, a time-per-expectation [ms] */ + FULFILLED_MONITOR_TIME_ADD_PER_EXPECTATION: number /** * If the iteration of the queue has been going for this time * allow skipping the rest of the queue in order to reiterate the high-prio expectations [ms] @@ -39,8 +39,8 @@ export function getDefaultConstants(): ExpectationTrackerConstants { return { // Default values: EVALUATE_INTERVAL: 5 * 1000, - FULLFILLED_MONITOR_TIME: 30 * 1000, - FULLFILLED_MONITOR_TIME_ADD_PER_EXPECTATION: 0.02, + FULFILLED_MONITOR_TIME: 30 * 1000, + FULFILLED_MONITOR_TIME_ADD_PER_EXPECTATION: 0.02, WORK_TIMEOUT_TIME: 30 * 1000, ALLOW_SKIPPING_QUEUE_TIME: 30 * 1000, SCALE_UP_TIME: 5 * 1000, diff --git a/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts b/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts index 59ba2f66..cb2dfae5 100644 --- a/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts +++ b/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts @@ -65,7 +65,7 @@ export const JsonDataCopy: ExpectationHandlerGenericWorker = { }, isExpectationFulfilled: async ( exp: Expectation.Any, - wasFullfilled: boolean, + wasFulfilled: boolean, worker: BaseWorker ): Promise => { if (!isJsonDataCopy(exp)) throw new Error(`Wrong exp.type: "${exp.type}"`) @@ -104,7 +104,7 @@ export const JsonDataCopy: ExpectationHandlerGenericWorker = { exp.endRequirement.version ) if (packageInfoSynced.needsUpdate) { - if (wasFullfilled) { + if (wasFulfilled) { // Remove the outdated result: await lookupTarget.handle.removePackageInfo(PackageInfoType.JSON, exp) } diff --git a/tests/internal-tests/src/__tests__/basic.spec.ts b/tests/internal-tests/src/__tests__/basic.spec.ts index c4a2da42..f254778c 100644 --- a/tests/internal-tests/src/__tests__/basic.spec.ts +++ b/tests/internal-tests/src/__tests__/basic.spec.ts @@ -16,7 +16,7 @@ import { import type * as fsMockType from '../__mocks__/fs' import type * as WNDType from '../__mocks__/windows-network-drive' import type * as QGatewayClientType from '../__mocks__/tv-automation-quantel-gateway-client' -import { prepareTestEnviromnent, TestEnviromnent } from './lib/setupEnv' +import { prepareTestEnvironment, TestEnvironment } from './lib/setupEnv' import { describeForAllPlatforms, waitUntil } from './lib/lib' import { getCorePackageInfoTarget, @@ -49,12 +49,12 @@ const SOURCE1 = protectString('source1') const TARGET0 = protectString('target0') const TARGET1 = protectString('target1') -let env: TestEnviromnent +let env: TestEnvironment describeForAllPlatforms( 'Basic', () => { beforeAll(async () => { - env = await prepareTestEnviromnent(false) // set to true to enable debug-logging + env = await prepareTestEnvironment(false) // set to true to enable debug-logging // Verify that the fs mock works: expect(fs.lstat).toBeTruthy() expect(fs.__mockReset).toBeTruthy() diff --git a/tests/internal-tests/src/__tests__/issues.spec.ts b/tests/internal-tests/src/__tests__/issues.spec.ts index 9944811a..3caa2e82 100644 --- a/tests/internal-tests/src/__tests__/issues.spec.ts +++ b/tests/internal-tests/src/__tests__/issues.spec.ts @@ -13,7 +13,7 @@ import { INNER_ACTION_TIMEOUT, } from '@sofie-package-manager/api' import type * as fsMockType from '../__mocks__/fs' -import { prepareTestEnviromnent, TestEnviromnent } from './lib/setupEnv' +import { prepareTestEnvironment, TestEnvironment } from './lib/setupEnv' import { waitUntil, waitTime, describeForAllPlatforms } from './lib/lib' import { getLocalSource, getLocalTarget } from './lib/containers' import { WorkerAgent } from '@sofie-package-manager/worker' @@ -54,12 +54,12 @@ const SOURCE0 = protectString('source0') const TARGET0 = protectString('target0') const TARGET1 = protectString('target1') -let env: TestEnviromnent +let env: TestEnvironment describeForAllPlatforms( 'Handle unhappy paths', () => { beforeAll(async () => { - env = await prepareTestEnviromnent(false) // set to true to enable debug-logging + env = await prepareTestEnvironment(false) // set to true to enable debug-logging // Verify that the fs mock works: expect(fs.lstat).toBeTruthy() expect(fs.__mockReset).toBeTruthy() @@ -536,7 +536,7 @@ describeForAllPlatforms( } ) function addCopyFileExpectation( - env: TestEnviromnent, + env: TestEnvironment, expectationId: ExpectationId, sources: Expectation.SpecificPackageContainerOnPackage.FileSource[], targets: [Expectation.SpecificPackageContainerOnPackage.FileTarget] diff --git a/tests/internal-tests/src/__tests__/lib/setupEnv.ts b/tests/internal-tests/src/__tests__/lib/setupEnv.ts index f210e2d7..23ec26bf 100644 --- a/tests/internal-tests/src/__tests__/lib/setupEnv.ts +++ b/tests/internal-tests/src/__tests__/lib/setupEnv.ts @@ -188,7 +188,7 @@ export async function setupExpectationManager( } } -export async function prepareTestEnviromnent(debugLogging: boolean): Promise { +export async function prepareTestEnvironment(debugLogging: boolean): Promise { const managerStatuses: Statuses = {} const expectationStatuses: ExpectationStatuses = {} const containerStatuses: ContainerStatuses = {} @@ -233,7 +233,7 @@ export async function prepareTestEnviromnent(debugLogging: boolean): Promise({ constants: { EVALUATE_INTERVAL: WAIT_SCAN_TIME - WAIT_JOB_TIME - 300, - FULLFILLED_MONITOR_TIME: WAIT_SCAN_TIME - WAIT_JOB_TIME - 300, + FULFILLED_MONITOR_TIME: WAIT_SCAN_TIME - WAIT_JOB_TIME - 300, WORK_TIMEOUT_TIME: WORK_TIMEOUT_TIME - 300, ERROR_WAIT_TIME: ERROR_WAIT_TIME - 300, @@ -348,7 +348,7 @@ export async function prepareTestEnviromnent(debugLogging: boolean): Promise { beforeAll(async () => { - env = await prepareTestEnviromnent(false) // set to true to enable debug-logging + env = await prepareTestEnvironment(false) // set to true to enable debug-logging }) afterAll(() => { env.terminate()