Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar committed Jul 8, 2021
1 parent 5910405 commit 2653f7b
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 23 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/scripts/install-firebase-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# TODO switch to official release once fixes are published.
git clone --single-branch --branch jh-ext-emu-fixes https://github.com/firebase/firebase-tools.git
cd firebase-tools
npm i
npm link --local
firebase --open-sesame extdev
37 changes: 37 additions & 0 deletions .github/workflows/storage-image-processing-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: storage-image-processing-api

on:
pull_request:
paths:
- "extensions/storage-image-processing-api/**"
- ".github/workflows/storage-image-processing-api.yaml"

push:
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"

env:
EXTENSION_PATH: "extensions/storage-image-processing-api"

jobs:
e2e:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: NPM Install
run: npm install
- name: Install Firebase CLI
run: ./.github/workflows/scripts/install-firebase-cli.sh
- name: Jest Tests
run: |
cd $EXTENSION_PATH/functions
npm run emulator &
sleep 10
npm run test
18 changes: 0 additions & 18 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,3 @@ jobs:
run: npm run check:typescript
- name: Check Spelling & Grammar
run: npm run check:spelling
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: NPM Install
run: npm install
- name: Install Firebase CLI
run: |
git clone --single-branch --branch jh-ext-emu-fixes https://github.com/firebase/firebase-tools.git
cd firebase-tools
npm i
npm link --local
firebase --open-sesame extdev
- name: Jest Tests
run: npm run test:ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ admin.initializeApp({
});

const imgSrc =
'http://localhost:5001/extensions-testing/us-central1/api/process/input~type:url~url:https%3A%2F%2Fimages.unsplash.com%2Fphoto-1624216873925-9c86b448a64c%3Fixid%3DMnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw4fHx8ZW58MHx8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D900%26q%3D60';
'http://localhost:5001/extensions-testing/europe-west2/api/process/input~type:url~url:https%3A%2F%2Fimages.unsplash.com%2Fphoto-1624216873925-9c86b448a64c%3Fixid%3DMnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw4fHx8ZW58MHx8fHw%253D%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D900%26q%3D60';

describe('e2e testing', () => {
test('successfully generate an image', async () => {
Expand All @@ -33,7 +33,7 @@ describe('e2e testing', () => {
test('throws an error if an input operation is not the first operation', async () => {
try {
await axios.get(
`http://localhost:5001/extensions-testing/us-central1/api/process/output~format:jpeg`,
`http://localhost:5001/extensions-testing/europe-west2/api/process/output~format:jpeg`,
);
} catch (error) {
expect(error.response.status).toBe(400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"emulator": "firebase ext:dev:emulators:start --test-params=test-params.env --project=extensions-testing",
"generate-readme": "firebase ext:info .. --markdown > ../README.md",
"test:watch": "jest --watch",
"test": "jest",
"test:ci": "npm run emulator & jest"
"test": "jest"
},
"engines": {
"node": "14"
Expand Down Expand Up @@ -38,6 +37,8 @@
"@types/cors": "^2.8.10",
"@types/lodash.get": "^4.4.6",
"@types/sharp": "0.28.3",
"@types/jest": "^26.0.23",
"jest": "^27.0.4",
"axios": "^0.21.1",
"firebase-functions-test": "^0.2.3",
"typescript": "^4.3.2"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"scripts": {
"prepare": "npm run lerna:bootstrap && npm run lerna:link",
"test": "lerna run test",
"test:ci": "lerna run test:ci",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
"check:linting": "eslint . --max-warnings=0",
"check:formatting": "prettier --check \"**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
Expand Down

0 comments on commit 2653f7b

Please sign in to comment.