Skip to content

Commit

Permalink
rerun lint and fix test in tools
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Dec 6, 2024
1 parent 1656a87 commit 7f68430
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 23 deletions.
5 changes: 4 additions & 1 deletion gax/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ protos/
samples/generated/
**/*.d.ts
*.d.ts
**/**.d.ts
**/**.d.ts
samples
esm/test/browser-test/karma.conf.js
esm/test/browser-test/webpack.config.js
1 change: 0 additions & 1 deletion gax/esm/src/grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export class GrpcClient {
}
}


/**
* Creates a gRPC credentials. It asks the auth data if necessary.
* @private
Expand Down
2 changes: 1 addition & 1 deletion gax/esm/src/streamingCalls/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {ResponseType} from '../apitypes.js';
// eslint-disable-next-line @typescript-eslint/no-var-requires
import duplexify from 'duplexify';
// eslint-disable-next-line @typescript-eslint/no-var-requires
import retryRequest, { Options } from 'retry-request';
import retryRequest, {Options} from 'retry-request';

// Directly copy over Duplexify interfaces
export interface DuplexifyOptions extends DuplexOptions {
Expand Down
1 change: 0 additions & 1 deletion gax/esm/test/browser-test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// Use `npm run browser-test` in the main google-gax package to run browser tests with Karma.

const path = require('path');
// eslint-disable-next-line n/no-missing-require
const isDocker = require('is-docker')();
const webpackConfig = require('./webpack.config.js');
webpackConfig.performance = {hints: false};
Expand Down
7 changes: 2 additions & 5 deletions gax/esm/test/browser-test/test/test.endtoend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ import * as http2 from 'http2';
import * as net from 'net';
import * as tls from 'tls';
import * as sinon from 'sinon'; // Import Sinon.JS for mocking
import { createByteLengthFunction } from 'google-gax';
import {createByteLengthFunction} from 'google-gax';

// Mock the http2 module with constants
const http2Mock = {
// ... other http2 mocks if needed ...
constants: {
HTTP2_HEADER_AUTHORITY: ':authority',
HTTP2_HEADER_AUTHORITY: ':authority',
HTTP2_HEADER_STATUS: ':status', // Add this line
// ... other constants as needed ...
},
};


// ... in your afterEach hook:

// ... (rest of your code) ...
Expand All @@ -61,7 +60,6 @@ const http2Mock = {
// }
// );


// // Mock 'net.createConnection'
// (net.createConnection as any).__original = net.createConnection;
// (net.createConnection as any).mockImplementation(
Expand Down Expand Up @@ -106,7 +104,6 @@ describe('Run tests against gRPC server', () => {
},
};


const opts = {
auth: authStub as unknown as GoogleAuth,
protocol: 'http',
Expand Down
4 changes: 2 additions & 2 deletions gax/esm/test/browser-test/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
dns: 'empty',
tls: 'empty',
'./framer': 'empty',
framer: 'empty'
framer: 'empty',
},
mode: 'production',
};
};
8 changes: 2 additions & 6 deletions gax/esm/test/unit/grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function gaxGrpc(options?: GrpcClientOptions) {
return new GrpcClient(options);
}

describe.only('grpc', () => {
describe('grpc', () => {
describe('grpcVersion', () => {
it('holds the proper grpc version', () => {
assert.strictEqual(gaxGrpc().grpcVersion, grpcVersion);
Expand Down Expand Up @@ -129,11 +129,7 @@ describe.only('grpc', () => {
address: any;
creds: any;
options: any;
constructor(
address: any,
creds: any,
options: any
) {
constructor(address: any, creds: any, options: any) {
this.address = address;
this.creds = creds;
this.options = options;
Expand Down
2 changes: 1 addition & 1 deletion gax/esm/test/unit/iamService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('IAM service', () => {
projectId: 'bogus',
});
client.initialize();
console.log('what is protos?')
console.log('what is protos?');
console.log(protos);
console.log(protos.google);
const request = generateSampleMessage(
Expand Down
1 change: 1 addition & 0 deletions gax/samples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"description": "Samples for the google-gax npm module.",
"license": "Apache-2.0",
"type": "commonjs",
"author": "Google LLC",
"engines": {
"node": ">=10"
Expand Down
2 changes: 1 addition & 1 deletion gax/samples/system-test/test.quickstart.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/**
* Copyright 2020 Google LLC
*
Expand All @@ -23,7 +24,6 @@ const cp = require('child_process');

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

// eslint-disable-next-line no-undef
const cwd = path.join(__dirname, '..');

describe('Quickstart', () => {
Expand Down
10 changes: 9 additions & 1 deletion tools/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "./node_modules/gts",
"root": true
"root": true,
"globals": {
"require": true
},
"env": {
"browser": true,
"node": true,
"es6": true
},
}
4 changes: 1 addition & 3 deletions tools/src/compileProtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const gaxProtos = path.join(
'..',
'..',
'..',
'..',
'protos'
);
const readdir = util.promisify(fs.readdir);
Expand Down Expand Up @@ -68,7 +69,6 @@ async function findProtoJsonFiles(directory: string): Promise<string[]> {
const files = await readdir(directory);
for (const file of files) {
const fullPath = path.join(directory, file);
console.log(fullPath);
const fileStat = await stat(fullPath);
if (fileStat.isFile() && file.match(PROTO_LIST_REGEX)) {
result.push(fullPath);
Expand Down Expand Up @@ -393,8 +393,6 @@ export async function generateRootName(directories: string[]): Promise<string> {
* `./src` folder of the given client library.
*/
export async function main(parameters: string[]): Promise<void> {
console.log("PWD")
console.log(process.cwd());
const protoJsonFiles: string[] = [];
let skipJson = false;
let esm = false;
Expand Down

0 comments on commit 7f68430

Please sign in to comment.