Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
build!: update library to use Node 12 (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl authored Jul 5, 2022
1 parent 22c4657 commit 12bd0f6
Show file tree
Hide file tree
Showing 25 changed files with 143 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ branchProtectionRules:
- "ci/kokoro: System test"
- docs
- lint
- test (10)
- test (12)
- test (14)
- test (16)
- cla/google
- windows
- OwlBot Post Processor
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
34 changes: 0 additions & 34 deletions .kokoro/continuous/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/continuous/node10/docs.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions .kokoro/continuous/node10/test.cfg

This file was deleted.

24 changes: 0 additions & 24 deletions .kokoro/continuous/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/continuous/node8/test.cfg
Empty file.
34 changes: 0 additions & 34 deletions .kokoro/presubmit/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/docs.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/lint.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node10/test.cfg
Empty file.
24 changes: 0 additions & 24 deletions .kokoro/presubmit/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node8/test.cfg
Empty file.
2 changes: 1 addition & 1 deletion .repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name_pretty": "Google Cloud Vision API",
"name": "vision",
"codeowner_team": "@googleapis/ml-apis",
"default_version": "v1p4beta1",
"default_version": "v1",
"language": "nodejs",
"api_shortname": "vision",
"library_type": "GAPIC_COMBO"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"author": "Google Inc",
"engines": {
"node": ">=10"
"node": ">=12.0.0"
},
"repository": "googleapis/nodejs-vision",
"main": "build/src/index.js",
Expand Down Expand Up @@ -45,8 +45,8 @@
"precompile": "gts clean"
},
"dependencies": {
"@google-cloud/promisify": "^2.0.0",
"google-gax": "^2.24.1",
"@google-cloud/promisify": "^3.0.0",
"google-gax": "^3.0.1",
"is": "^3.3.0"
},
"devDependencies": {
Expand All @@ -58,17 +58,17 @@
"@types/uuid": "^8.0.0",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"gts": "^2.0.0",
"gts": "^4.0.0",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^2.0.0",
"jsdoc-region-tag": "^2.0.0",
"linkinator": "^2.0.3",
"mocha": "^8.0.0",
"linkinator": "^3.1.0",
"mocha": "^10.0.0",
"null-loader": "^4.0.0",
"pack-n-play": "^1.0.0-2",
"sinon": "^14.0.0",
"ts-loader": "^9.0.0",
"typescript": "^3.8.3",
"typescript": "^4.6.4",
"uuid": "^8.0.0",
"webpack": "^5.0.0",
"webpack-cli": "^4.0.0"
Expand Down
6 changes: 3 additions & 3 deletions samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=10.17.0"
"node": ">=12.0.0"
},
"files": [
"*.js"
Expand All @@ -16,13 +16,13 @@
"@google-cloud/vision": "^2.4.2",
"natural": "^5.0.0",
"pureimage": "^0.3.0",
"redis": "^4.0.0",
"redis": "~4.0.0",
"yargs": "^16.0.0"
},
"devDependencies": {
"@google-cloud/storage": "^6.0.0",
"chai": "^4.2.0",
"mocha": "^8.0.0",
"mocha": "^10.0.0",
"uuid": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion samples/system-test/async-batch-annotate-images.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ describe('detect v1 p4 beta1', () => {
const output = execSync(
`${cmd} gs://${bucketName}/${files[1].name} gs://${bucketName}/out/`
);
assert.match(output, /Json saved to: gs:\/\//);
assert.match(output, /Output written to GCS with prefix: gs:\/\//);
});
});
6 changes: 4 additions & 2 deletions samples/system-test/detect.v1p1beta1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ describe('detect v1 p1 beta1', () => {
assert.match(output, /Word confidence:/);
});

it('should detect safe search properties from image file', async () => {
// Refs: https://github.com/googleapis/nodejs-vision/issues/1025
it.skip('should detect safe search properties from image file', async () => {
const output = execSync(`${cmd} safe-search ${files[1].localPath}`);
assert.match(output, /VERY_LIKELY/);
assert.match(output, /Racy:/);
});

it('should detect web entities including best guess labels', async () => {
// Refs: https://github.com/googleapis/nodejs-vision/issues/1025
it.skip('should detect web entities including best guess labels', async () => {
const output = execSync(`${cmd} web ${files[2].localPath}`);
assert.match(output, /Best guess label: palace of fine arts/);
});
Expand Down
26 changes: 17 additions & 9 deletions samples/system-test/importProductSets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,32 @@
'use strict';

const {assert} = require('chai');
const {describe, it} = require('mocha');
const {describe, it, before} = require('mocha');
const cp = require('child_process');
const vision = require('@google-cloud/vision');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

const cmd = 'node productSearch/importProductSets';
const productSearchClient = new vision.ProductSearchClient();
describe('import product sets', () => {
let testImportProductSets;
let projectId;

//Shared fixture data for product tests
const testImportProductSets = {
projectId: process.env.GCLOUD_PROJECT,
location: 'us-west1',
gcsUri: 'gs://cloud-samples-data/vision/product_search/product_sets.csv',
};
before(async () => {
projectId = await productSearchClient.getProjectId();

//Shared fixture data for product tests
testImportProductSets = {
projectId,
location: 'us-west1',
gcsUri: 'gs://cloud-samples-data/vision/product_search/product_sets.csv',
};
});

describe('import product sets', () => {
it('should import a Product Set', async () => {
const output = execSync(
`${cmd} ${testImportProductSets.projectId} ${testImportProductSets.location} ${testImportProductSets.gcsUri}`
`${cmd} ${projectId} ${testImportProductSets.location} ${testImportProductSets.gcsUri}`
);
assert.match(output, /Processing done./);
});
Expand Down
41 changes: 22 additions & 19 deletions samples/system-test/productSearch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,31 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
const productSearchClient = new vision.ProductSearchClient();
const cmd = 'node productSearch';

// Shared fixture data for product tests
const testProductSet = {
projectId: process.env.GCLOUD_PROJECT,
location: 'us-west1',
productCategory: 'homegoods',
productId: `test_product_id${uuid.v4()}`,
productDisplayName: 'test_product_display_name_1',
productSetId: `test_product_set_id${uuid.v4()}`,
productSetDisplayName: 'test_product_set_display_name_1',
};
// Refs: https://github.com/googleapis/nodejs-vision/issues/1025
describe.skip('product search', () => {
let projectId;
let testProductSet;

testProductSet.productSetPath = productSearchClient.productSetPath(
testProductSet.projectId,
testProductSet.location,
testProductSet.productSetId
);
before(async () => {
projectId = await productSearchClient.getProjectId();

testProductSet.createdProductPaths = [];
testProductSet.createdProductSetPaths = [];
// Shared fixture data for product tests
const testProductSet = {
projectId,
location: 'us-west1',
productCategory: 'homegoods',
productId: `test_product_id${uuid.v4()}`,
productDisplayName: 'test_product_display_name_1',
productSetId: `test_product_set_id${uuid.v4()}`,
productSetDisplayName: 'test_product_set_display_name_1',
};

testProductSet.productSetPath = productSearchClient.productSetPath(
testProductSet.projectId,
testProductSet.location,
testProductSet.productSetId
);

describe('product search', () => {
before(async () => {
// Create a test product set for each test
await productSearchClient.createProduct({
parent: productSearchClient.locationPath(
Expand Down
Loading

0 comments on commit 12bd0f6

Please sign in to comment.