Skip to content

Commit 9d1b80e

Browse files
authored
ci(genai): Update genai directory to run tests in specific directories only (#4203)
1 parent 2db5b9d commit 9d1b80e

File tree

91 files changed

+330
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+330
-107
lines changed

.github/config/nodejs-dev.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
"functions/v2/tips/retry",
186186
"functions/v2/typed/googlechatbot",
187187
"functions/v2/typed/greeting",
188+
"genai", // parent directory
188189
"generative-ai/snippets",
189190
"healthcare/consent",
190191
"healthcare/datasets",

.github/config/nodejs.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"functions/http/uploadFile", // no tests exist
7171
"functions/log", // parent directory
7272
"functions/pubsub", // parent directory
73+
"genai", // parent directory
7374
"memorystore/redis", // parent directory
7475
"recaptcha_enterprise/demosite/app", // no tests exist
7576

genai/bounding-box/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "nodejs-genai-bounding-box",
3+
"private": true,
4+
"license": "Apache-2.0",
5+
"author": "Google LLC",
6+
"engines": {
7+
"node": ">=16.0.0"
8+
},
9+
"scripts": {
10+
"test": "c8 mocha -p -j 2 --timeout 2400000 test/*.test.js"
11+
},
12+
"dependencies": {
13+
"@google/genai": "1.30.0",
14+
"canvas": "^3.2.0",
15+
"node-fetch": "^2.7.0"
16+
},
17+
"devDependencies": {
18+
"c8": "^10.0.0",
19+
"chai": "^4.5.0",
20+
"mocha": "^10.0.0"
21+
}
22+
}

genai/test/boundingbox-with-txt-img.test.js renamed to genai/bounding-box/test/boundingbox-with-txt-img.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {assert} = require('chai');
1818
const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
21-
const sample = require('../bounding-box/boundingbox-with-txt-img');
21+
const sample = require('../boundingbox-with-txt-img');
2222

2323
describe('boundingbox-with-txt-img', async () => {
2424
it('should return the bounding box', async function () {

genai/content-cache/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "nodejs-genai-content-cache",
3+
"private": true,
4+
"license": "Apache-2.0",
5+
"author": "Google LLC",
6+
"engines": {
7+
"node": ">=16.0.0"
8+
},
9+
"scripts": {
10+
"test": "c8 mocha -p -j 2 --timeout 2400000 test/*.test.js"
11+
},
12+
"dependencies": {
13+
"@google/genai": "1.30.0",
14+
"luxon": "^3.7.1"
15+
},
16+
"devDependencies": {
17+
"c8": "^10.0.0",
18+
"chai": "^4.5.0",
19+
"mocha": "^10.0.0"
20+
}
21+
}

genai/test/content-cache-create-use-update-delete.test.js renamed to genai/content-cache/test/content-cache-create-use-update-delete.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
2121

22-
const createSample = require('../content-cache/content-cache-create-with-txt-gcs-pdf.js');
23-
const useSample = require('../content-cache/content-cache-use-with-txt.js');
24-
const updateSample = require('../content-cache/content-cache-update.js');
25-
const deleteSample = require('../content-cache/content-cache-delete.js');
26-
const {delay} = require('./util');
22+
const createSample = require('../content-cache-create-with-txt-gcs-pdf.js');
23+
const useSample = require('../content-cache-use-with-txt.js');
24+
const updateSample = require('../content-cache-update.js');
25+
const deleteSample = require('../content-cache-delete.js');
26+
const {delay} = require('../../test/util');
2727

2828
describe('content-cache-create-use-update-delete', async function () {
2929
this.timeout(600000);

genai/test/content-cache-list.test.js renamed to genai/content-cache/test/content-cache-list.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {assert} = require('chai');
1818
const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
21-
const sample = require('../content-cache/content-cache-list.js');
21+
const sample = require('../content-cache-list.js');
2222

2323
describe('contentcache-list', async () => {
2424
it('should return object with names of catches', async () => {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "nodejs-genai-controlled-generation",
3+
"private": true,
4+
"license": "Apache-2.0",
5+
"author": "Google LLC",
6+
"engines": {
7+
"node": ">=16.0.0"
8+
},
9+
"scripts": {
10+
"test": "c8 mocha -p -j 2 --timeout 2400000 test/*.test.js"
11+
},
12+
"dependencies": {
13+
"@google/genai": "1.30.0"
14+
},
15+
"devDependencies": {
16+
"c8": "^10.0.0",
17+
"chai": "^4.5.0",
18+
"mocha": "^10.0.0"
19+
}
20+
}

genai/test/ctrlgen-with-class-schema.test.js renamed to genai/controlled-generation/test/ctrlgen-with-class-schema.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const {assert} = require('chai');
1818
const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
21-
const sample = require('../controlled-generation/ctrlgen-with-class-schema.js');
21+
const sample = require('../ctrlgen-with-class-schema.js');
2222

2323
describe('ctrlgen-with-class-schema', () => {
2424
it('should generate text content in Json', async function () {

genai/test/ctrlgen-with-enum-class-schema.test.js renamed to genai/controlled-generation/test/ctrlgen-with-enum-class-schema.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const {assert} = require('chai');
1818
const {describe, it} = require('mocha');
1919

2020
const projectId = process.env.CAIP_PROJECT_ID;
21-
const sample = require('../controlled-generation/ctrlgen-with-enum-class-schema.js');
22-
const {delay} = require('./util');
21+
const sample = require('../ctrlgen-with-enum-class-schema.js');
22+
const {delay} = require('../../test/util');
2323

2424
describe('ctrlgen-with-enum-class-schema', () => {
2525
it('should generate text content matching enum schema', async function () {

0 commit comments

Comments
 (0)