GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add system test running capabilities (#1592) · googleapis/google-cloud-node@a3bbe26

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handwritten/bigquery/system-test
    • env.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handwritten/bigquery/system-test/env.js‎

Copy file name to clipboardExpand all lines: handwritten/bigquery/system-test/env.js
+18-8Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@
1616

1717
'use strict';
1818

19-
if (!process.env.GCLOUD_TESTS_PROJECT_ID && !process.env.GCLOUD_TESTS_KEY) {
20-
var error = [
19+
var googleCloudConfig = {};
20+
21+
if (!process.env.GCLOUD_TESTS_CREDENTIALS &&
22+
!process.env.GCLOUD_TESTS_PROJECT_ID &&
23+
!process.env.GCLOUD_TESTS_KEY) {
24+
throw new Error([
2125
'To run the system tests, you need to set some environment variables.',
2226
'Please check the Contributing guide for instructions.'
23-
].join('\n');
24-
throw error;
27+
].join('\n'));
28+
}
29+
30+
var credentials = process.env.GCLOUD_TESTS_CREDENTIALS;
31+
32+
if (credentials) {
33+
googleCloudConfig.credentials = JSON.parse(credentials);
34+
googleCloudConfig.projectId = credentials.project_id;
35+
} else {
36+
googleCloudConfig.projectId = process.env.GCLOUD_TESTS_PROJECT_ID;
37+
googleCloudConfig.keyFilename = process.env.GCLOUD_TESTS_KEY;
2538
}
2639

27-
module.exports = {
28-
keyFilename: process.env.GCLOUD_TESTS_KEY,
29-
projectId: process.env.GCLOUD_TESTS_PROJECT_ID
30-
};
40+
module.exports = googleCloudConfig;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.