Skip to content

Commit 7e8939f

Browse files
committed
fix(integration_test): Use bash for source command
1 parent 571f3fc commit 7e8939f

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

cloudbuild.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
steps:
22
- name: "node:18"
3-
entrypoint: "npm"
3+
id: "Install dependencies"
44
dir: "integration_test"
5+
entrypoint: "npm"
56
args: ["install"]
67
- name: "node:18"
7-
entrypoint: "npx"
8+
id: "Set Project ID"
89
dir: "integration_test"
10+
entrypoint: "npx"
911
args: ["firebase", "use", "cf3-integration-tests-d7be6"]
1012
- name: "node:18"
11-
entrypoint: "npm"
13+
id: "Run tests"
1214
dir: "integration_test"
15+
entrypoint: "npm"
1316
args: ["start"]
1417

1518
options:

integration_test/setup.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ function buildPythonSdk() {
8181
execSync(
8282
"source venv/bin/activate && python -m pip install --upgrade build",
8383

84-
{ stdio: "inherit" }
84+
{ stdio: "inherit", shell: "bash" }
8585
);
8686

8787
execSync("source venv/bin/activate && python -m build -s", {
8888
stdio: "inherit",
89+
shell: "bash",
8990
});
9091

9192
// move the generated tarball package to functions
@@ -97,13 +98,7 @@ function buildPythonSdk() {
9798
.find((file) => file.match(/^firebase_functions-.*\.tar\.gz$/));
9899

99100
if (generatedFile) {
100-
const targetPath = path.join(
101-
"integration_tests",
102-
103-
"functions",
104-
105-
`firebase_functions.tar.gz`
106-
);
101+
const targetPath = path.join("integration_tests", "functions", `firebase_functions.tar.gz`);
107102

108103
fs.renameSync(path.join("dist", generatedFile), targetPath);
109104

integration_test/tests/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export async function createTask(
114114
payload: Record<string, any>
115115
) {
116116
const client = new CloudTasksClient();
117-
const queuePath = client.queuePath(project, location, queue);
117+
// const queuePath = client.queuePath(project, location, queue);
118118
// try {
119119
// await client.getQueue({ name: queuePath });
120120
// } catch (err: any) {
@@ -169,10 +169,11 @@ export async function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Pr
169169
let count = 0;
170170
let lastError: Error | undefined;
171171
const { maxRetries = 20, checkForUndefined = true } = options ?? {};
172+
let result: Awaited<T> | null = null;
172173

173174
while (count < maxRetries) {
174175
try {
175-
const result = await fn();
176+
result = await fn();
176177
if (!checkForUndefined || result) {
177178
return result;
178179
}
@@ -187,5 +188,5 @@ export async function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Pr
187188
throw lastError;
188189
}
189190

190-
throw new Error("Max retries exceeded");
191+
throw new Error(`Max retries exceeded: result = ${result}`);
191192
}

0 commit comments

Comments
 (0)