Skip to content

Commit

Permalink
Add CHANGELOG entry
Browse files Browse the repository at this point in the history
  • Loading branch information
tohhsinpei committed Mar 25, 2022
1 parent f068c9f commit 372d71d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,3 +1,4 @@
- Fixes bug where resumable uploads were not setting custom metadata on upload (#3398).
- Fixes bug where GCS metadataUpdate cloud functions were triggered in incorrect situations (#3398).
- Fixes bug where quoted escape sequences in .env files were incompletely unescaped. (#4270)
- Fixes issue with importing Storage Emulator data exported prior to v10.3.0 (#4358).
23 changes: 17 additions & 6 deletions scripts/storage-emulator-integration/import/tests.ts
@@ -1,4 +1,6 @@
import * as path from "path";
import supertest = require("supertest");

import { Emulators } from "../../../src/emulator/types";
import { TriggerEndToEndTest } from "../../integration-helpers/framework";
import {
Expand All @@ -9,31 +11,40 @@ import {
TEST_SETUP_TIMEOUT,
} from "../utils";

const FIREBASE_PROJECT = process.env.FBTOOLS_TARGET_PROJECT || "fake-project-id";

describe("Import Emulator Data", () => {
const FIREBASE_PROJECT = "fake-project-id";
const bucket = `${FIREBASE_PROJECT}.appspot.com`;
const emulatorConfig = readEmulatorConfig(FIREBASE_EMULATOR_CONFIG);
const STORAGE_EMULATOR_HOST = getStorageEmulatorHost(emulatorConfig);
const test = new TriggerEndToEndTest(FIREBASE_PROJECT, __dirname, emulatorConfig);

it("retrieves file from imported flattened emulator data", async function (this) {
this.timeout(TEST_SETUP_TIMEOUT);
await test.startEmulators(["--only", Emulators.STORAGE, "--import=./flattened-emulator-data"]);
await test.startEmulators([
"--only",
Emulators.STORAGE,
"--import",
path.join(__dirname, "flattened-emulator-data"),
]);

await supertest(STORAGE_EMULATOR_HOST)
.get(`/v0/b/${bucket}/o/test_upload.jpg`)
.set({Authorization: "Bearer owner"})
.set({ Authorization: "Bearer owner" })
.expect(200);
});

it("retrieves file from imported nested emulator data", async function (this) {
this.timeout(TEST_SETUP_TIMEOUT);
await test.startEmulators(["--only", Emulators.STORAGE, "--import=./nested-emulator-data"]);
await test.startEmulators([
"--only",
Emulators.STORAGE,
"--import",
path.join(__dirname, "flattened-emulator-data"),
]);

await supertest(STORAGE_EMULATOR_HOST)
.get(`/v0/b/${bucket}/o/test_upload.jpg`)
.set({Authorization: "Bearer owner"})
.set({ Authorization: "Bearer owner" })
.expect(200);
});

Expand Down

0 comments on commit 372d71d

Please sign in to comment.