-
Notifications
You must be signed in to change notification settings - Fork 2k
ci(imagemagick): add test isolation for functions imagemagick #3987
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
Changes from all commits
381e688
8298a4e
44fadea
943558d
a54e7ad
377edac
815f025
1a6ab73
59f9481
cf4b01c
4719f99
f1d40f5
37ab328
cdcb8d5
757312b
cf5068d
0cfd17f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "env": { | ||
| "FUNCTIONS_BUCKET": "nodejs-docs-samples-tests", | ||
| "BLURRED_BUCKET_NAME": "nodejs-docs-samples-tests-imagick" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "env": { | ||
| "FUNCTIONS_BUCKET": "nodejs-docs-samples-tests", | ||
| "BLURRED_BUCKET_NAME": "nodejs-docs-samples-tests-imagick" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| 'use strict'; | ||
|
|
||
| const assert = require('assert'); | ||
| const {execSync} = require('child_process'); | ||
| const {Storage} = require('@google-cloud/storage'); | ||
| const sinon = require('sinon'); | ||
| const supertest = require('supertest'); | ||
|
|
@@ -33,6 +34,11 @@ const testFiles = { | |
|
|
||
| require('../index'); | ||
|
|
||
| // ImageMagick is available by default in Cloud Run Functions environments | ||
| // https://cloud.google.com/functions/1stgendocs/tutorials/imagemagick-1st-gen.md#importing_dependencies | ||
| // Manually install it for testing only. | ||
| execSync('sudo apt-get install imagemagick -y'); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion(non-blocking): Move this into an additional before hook below and switch to an async exec for a potentially minor performance gain.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. installing this async was causing issues, so I'm making sure the change happens before the before using this method |
||
|
|
||
| describe('functions/imagemagick tests', () => { | ||
| before(async () => { | ||
| let exists; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross-checked that Imagemagick is still included in the system packages for v2+: https://cloud.google.com/functions/docs/reference/system-packages ✅