Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test/integration): fix broken integration test #8203

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/dataconnect-test/templates/connector.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
connectorId: "connectorId"
connectorId: "1"
authMode: "PUBLIC"
4 changes: 2 additions & 2 deletions scripts/dataconnect-test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const FIREBASE_PROJECT = process.env.FBTOOLS_TARGET_PROJECT || "";
const FIREBASE_DEBUG = process.env.FIREBASE_DEBUG || "";

function expected(

Check warning on line 14 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
serviceId: string,
databaseId: string,
schemaUpdateTime: string,
Expand All @@ -24,21 +24,21 @@
schemaUpdateTime,
connectors: [
{
connectorId: "connectorId",
connectorId: "1",
connectorLastUpdated,
},
],
};
}

async function cleanUpService(projectId: string, serviceId: string, databaseId: string) {

Check warning on line 34 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
await client.deleteServiceAndChildResources(
`projects/${projectId}/locations/us-central1/services/${serviceId}`,
);
await deleteDatabase(projectId, "dataconnect-test", databaseId);
}

async function list() {

Check warning on line 41 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
return await cli.exec(
"dataconnect:services:list",
FIREBASE_PROJECT,
Expand All @@ -51,7 +51,7 @@
);
}

async function migrate(force: boolean) {

Check warning on line 54 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
const args = force ? ["--force"] : [];
if (FIREBASE_DEBUG) {
args.push("--debug");
Expand All @@ -68,7 +68,7 @@
);
}

async function deploy(force: boolean) {

Check warning on line 71 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
const args = ["--only", "dataconnect"];
if (force) {
args.push("--force");
Expand All @@ -81,7 +81,7 @@
});
}

function toPath(p: string) {

Check warning on line 84 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
return path.join(__dirname, p);
}

Expand Down Expand Up @@ -124,7 +124,7 @@
return { serviceId, databaseId };
}

function prepareStep(step: Step) {

Check warning on line 127 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing return type on function
fs.writeFileSync(toPath("fdc-test/schema/schema.gql"), step.schemaGQL, { mode: 420 /* 0o644 */ });
fs.writeFileSync(toPath("fdc-test/connector/connector.gql"), step.connectorGQL, {
mode: 420 /* 0o644 */,
Expand All @@ -145,7 +145,7 @@
});

afterEach(async function (this) {
this.timeout(10000);
this.timeout(100000); // Need to wait a long time for cleanup.
fs.rmSync(fdcTest, { recursive: true, force: true });
await cleanUpService(FIREBASE_PROJECT, serviceId, databaseId);
});
Expand All @@ -158,8 +158,8 @@
await deploy(false);
await migrate(true);
await deploy(true);
} catch (err: any) {

Check warning on line 161 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
expect(err.expectErr, `Unexpected error: ${err.message}`).to.be.true;

Check warning on line 162 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .expectErr on an `any` value

Check warning on line 162 in scripts/dataconnect-test/tests.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
}
expect(step.expectErr).to.be.false;
const result = await list();
Expand Down
Loading