Skip to content

Commit 5a26fec

Browse files
committed
fix topaz install
1 parent 778717d commit 5a26fec

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

__tests__/integration/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe("Integration", () => {
2929

3030
beforeAll(async () => {
3131
topaz = new Topaz();
32-
await topaz.stop();
3332
await topaz.start();
3433
const config = {
3534
url: "localhost:9292",
@@ -41,6 +40,7 @@ describe("Integration", () => {
4140

4241
afterAll(async () => {
4342
jest.useRealTimers();
43+
await topaz.stop();
4444
});
4545

4646
describe("express", () => {

__tests__/topaz.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import fs from "fs";
22
import util from "node:util";
3-
import path from "path";
43

54
import { DirectoryServiceV3 } from "../lib";
65
import { log } from "../lib/log";
@@ -13,8 +12,7 @@ export const TOPAZ_TIMEOUT =
1312

1413
export class Topaz {
1514
async start() {
16-
await this.backup();
17-
await execute("topaz templates install todo -f --no-console");
15+
await execute("topaz templates install todo -f --no-console -i");
1816

1917
const certsDir = await this.caCert();
2018

@@ -37,7 +35,6 @@ export class Topaz {
3735

3836
async stop() {
3937
await execute("topaz stop");
40-
await this.restore();
4138
}
4239

4340
async caCert() {
@@ -57,32 +54,6 @@ export class Topaz {
5754
await execute("topaz config info | jq -r '.config.topaz_cfg_dir'")
5855
).replace(/(\r\n|\n|\r)/gm, "")}`;
5956
}
60-
61-
async backup() {
62-
fs.rename(
63-
path.join(await this.dbDir(), "directory.db"),
64-
path.join(await this.dbDir(), "directory.bak"),
65-
() => {},
66-
);
67-
fs.rename(
68-
path.join(await this.configDir(), "todo.yaml"),
69-
path.join(await this.configDir(), "todo.bak"),
70-
() => {},
71-
);
72-
}
73-
74-
async restore() {
75-
fs.rename(
76-
path.join(await this.dbDir(), "directory.bak"),
77-
path.join(await this.dbDir(), "directory.db"),
78-
() => {},
79-
);
80-
fs.rename(
81-
path.join(await this.configDir(), "todo.bak"),
82-
path.join(await this.configDir(), "todo.yaml"),
83-
() => {},
84-
);
85-
}
8657
}
8758

8859
const retry = async <T>(

0 commit comments

Comments
 (0)