From a73834fe1abb860129a068800f60ee44e420f8b8 Mon Sep 17 00:00:00 2001 From: pmconne <22944042+pmconne@users.noreply.github.com> Date: Wed, 25 Dec 2024 09:21:02 -0500 Subject: [PATCH] fix everything except performance tests that want to apply single changeset. --- .../test/cases/identity-transformer.ts | 2 +- packages/performance-tests/test/cases/prepare-fork.ts | 2 +- packages/performance-tests/test/iModelUtils.ts | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/performance-tests/test/cases/identity-transformer.ts b/packages/performance-tests/test/cases/identity-transformer.ts index ab6b0367..42b62814 100644 --- a/packages/performance-tests/test/cases/identity-transformer.ts +++ b/packages/performance-tests/test/cases/identity-transformer.ts @@ -50,7 +50,7 @@ export default async function identityTransformer(context: TestCaseContext) { path.join(os.tmpdir(), "identity-test-schemas-dump-") ); // eslint-disable-next-line @itwin/no-internal, deprecation/deprecation - sourceDb.nativeDb.exportSchemas(schemaDumpDir); + sourceDb.exportSchemas(schemaDumpDir); Logger.logInfo(loggerCategory, `dumped schemas to: ${schemaDumpDir}`); throw err; } finally { diff --git a/packages/performance-tests/test/cases/prepare-fork.ts b/packages/performance-tests/test/cases/prepare-fork.ts index bdb6147b..8c3a65bd 100644 --- a/packages/performance-tests/test/cases/prepare-fork.ts +++ b/packages/performance-tests/test/cases/prepare-fork.ts @@ -52,7 +52,7 @@ export default async function prepareFork(context: TestCaseContext) { path.join(os.tmpdir(), "fork-test-schemas-dump-") ); // eslint-disable-next-line @itwin/no-internal, deprecation/deprecation - sourceDb.nativeDb.exportSchemas(schemaDumpDir); + sourceDb.exportSchemas(schemaDumpDir); Logger.logInfo(loggerCategory, `dumped schemas to: ${schemaDumpDir}`); throw err; } finally { diff --git a/packages/performance-tests/test/iModelUtils.ts b/packages/performance-tests/test/iModelUtils.ts index e83ff963..610bc88f 100644 --- a/packages/performance-tests/test/iModelUtils.ts +++ b/packages/performance-tests/test/iModelUtils.ts @@ -31,16 +31,7 @@ export interface IModelParams { // TODO: dedup with other packages // for testing purposes only, based on SetToStandalone.ts, force a snapshot to mimic a standalone iModel export function setToStandalone(iModelPath: string) { - // eslint-disable-next-line @itwin/no-internal, deprecation/deprecation - const nativeDb = new IModelHost.platform.DgnDb(); - nativeDb.openIModel(iModelPath, OpenMode.ReadWrite); - nativeDb.setITwinId(Guid.empty); // empty iTwinId means "standalone" - nativeDb.saveChanges(); // save change to iTwinId - nativeDb.deleteAllTxns(); // necessary before resetting briefcaseId - nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned - nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); - nativeDb.saveChanges(); // save change to briefcaseId - nativeDb.closeFile(); + StandaloneDb.convertToStandalone(iModelPath); } export function generateTestIModel(iModelParam: IModelParams): TestIModel {