()
| 95 | |
| 96 | // Each test run should use a random serviceId and databaseId. |
| 97 | function newTestRun(): { serviceId: string; databaseId: string } { |
| 98 | const id = getRandomString(6); |
| 99 | const serviceId = `cli-e2e-service-${id}`; |
| 100 | const databaseId = `cli-e2e-database-${id}`; |
| 101 | |
| 102 | const dataconnectYamlTemplate = fs.readFileSync(toPath("templates/dataconnect.yaml")).toString(); |
| 103 | const connectorYamlTemplate = fs.readFileSync(toPath("templates/connector.yaml")).toString(); |
| 104 | const subbedDataconnectYaml = dataconnectYamlTemplate |
| 105 | .replace("__serviceId__", serviceId) |
| 106 | .replace("__databaseId__", databaseId); |
| 107 | if (!fs.existsSync(fdcTest)) { |
| 108 | fs.mkdirSync(fdcTest); |
| 109 | } |
| 110 | if (!fs.existsSync(toPath("fdc-test/connector"))) { |
| 111 | fs.mkdirSync(toPath("fdc-test/connector")); |
| 112 | } |
| 113 | if (!fs.existsSync(toPath("fdc-test/schema"))) { |
| 114 | fs.mkdirSync(toPath("fdc-test/schema")); |
| 115 | } |
| 116 | fs.writeFileSync(toPath("fdc-test/dataconnect.yaml"), subbedDataconnectYaml, { |
| 117 | mode: 420 /* 0o644 */, |
| 118 | }); |
| 119 | fs.writeFileSync(toPath("fdc-test/connector/connector.yaml"), connectorYamlTemplate, { |
| 120 | mode: 420 /* 0o644 */, |
| 121 | }); |
| 122 | return { serviceId, databaseId }; |
| 123 | } |
| 124 | |
| 125 | function prepareStep(step: Step) { |
| 126 | fs.writeFileSync(toPath("fdc-test/schema/schema.gql"), step.schemaGQL, { mode: 420 /* 0o644 */ }); |
no test coverage detected
searching dependent graphs…