Skip to content
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

fix(tests): delete flaky test #1565

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ jobs:
- run: node --version
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v3
with:
name: actions ${{ matrix.node }}
fail_ci_if_error: true
windows:
runs-on: windows-latest
env:
Expand All @@ -61,11 +56,6 @@ jobs:
node-version: 14
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v3
with:
name: actions windows
fail_ci_if_error: true
lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ async function run(steps: string[]) {

run(steps).catch(err => {
console.error(err);
// eslint-disable-next-line no-process-exit
// eslint-disable-next-line n/no-process-exit
process.exit(1);
});
2 changes: 1 addition & 1 deletion src/plugins/plugin-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import {IncomingMessage, ServerResponse} from 'http';
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
import {parse as urlParse} from 'url';

import {PluginTypes} from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plugin-hapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import {ServerResponse} from 'http';
import * as shimmer from 'shimmer';
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
import {parse as urlParse} from 'url';

import {PluginTypes} from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plugin-http2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// This is imported only for types. Generated .js file should NOT load 'http2'.
// `http2` must be used only in type annotations, not in expressions.
// eslint-disable-next-line node/no-unsupported-features/node-builtins
// eslint-disable-next-line n/no-unsupported-features/node-builtins
import * as http2 from 'http2';
import * as shimmer from 'shimmer';
import {URL} from 'url';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/plugin-koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import {ServerResponse} from 'http';
import * as shimmer from 'shimmer';
// eslint-disable-next-line node/no-deprecated-api
// eslint-disable-next-line n/no-deprecated-api
import {parse as urlParse} from 'url';

import {PluginTypes} from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/trace-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class TraceWriter extends Service {
this.flushBuffer();
if (onUncaughtException === 'flushAndExit') {
setTimeout(() => {
// eslint-disable-next-line no-process-exit
// eslint-disable-next-line n/no-process-exit
process.exit(1);
}, 2000);
}
Expand Down
2 changes: 1 addition & 1 deletion test/non-interference/http-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const testCommonPath = [
});
if (!testCommonPath) {
console.error('No common.js or common/index.js found in test directory');
// eslint-disable-next-line no-process-exit
// eslint-disable-next-line n/no-process-exit
process.exit(1);
}
cp.execFileSync('sed', [
Expand Down
4 changes: 2 additions & 2 deletions test/non-interference/start-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'use strict';

const shimmer = require('shimmer');
// eslint-disable-next-line node/no-missing-require
// eslint-disable-next-line n/no-missing-require
const util = require('../../build/src/util.js');
// Stub generateTraceContext so that it always returns the same thing.
// This is because web framework unit tests check that similar/identical
Expand All @@ -29,7 +29,7 @@ shimmer.wrap(util, 'generateTraceContext', () => {
return 'ffeeddccbbaa99887766554433221100/0?o=1';
};
});
// eslint-disable-next-line node/no-missing-require
// eslint-disable-next-line n/no-missing-require
require('../..').start({
projectId: '0',
logLevel: 1,
Expand Down
6 changes: 3 additions & 3 deletions test/plugins/test-trace-http2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import {describe, it, after, afterEach, before} from 'mocha';
// This is imported only for types. Generated .js file should NOT load 'http2'
// in this place. It is dynamically loaded later from each test suite below.
// eslint-disable-next-line node/no-unsupported-features/node-builtins
// eslint-disable-next-line n/no-unsupported-features/node-builtins
import * as http2Types from 'http2';
import * as semver from 'semver';
import * as stream from 'stream';
Expand Down Expand Up @@ -46,7 +46,7 @@
traceTestModule.setPluginLoaderForTest();
traceTestModule.setCLSForTest();
traceTestModule.start();
// eslint-disable-next-line node/no-unsupported-features/node-builtins
// eslint-disable-next-line n/no-unsupported-features/node-builtins
http2 = require('http2');
});

Expand Down Expand Up @@ -81,7 +81,7 @@
});

it('should patch the necessary functions', () => {
assert.strictEqual(http2.connect['__wrapped'], true);
assert.strictEqual((http2 as any).connect['__wrapped'], true);

Check warning on line 84 in test/plugins/test-trace-http2.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
});

it('should accurately measure request time', done => {
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/test-trace-node-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// eslint-disable-next-line node/no-extraneous-import
// eslint-disable-next-line n/no-extraneous-import
import * as fetchTypes from 'node-fetch'; // For types only.
import * as testTraceModule from '../trace';
import * as assert from 'assert';
Expand Down
171 changes: 0 additions & 171 deletions test/test-plugins-no-project-num.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}

export function setLoggerForTest(impl?: typeof logger.Logger) {
if (logger.Logger.__wrapped) {
if ((logger.Logger as any).__wrapped) {

Check warning on line 123 in test/trace.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
shimmer.unwrap(logger, 'Logger');
}
if (impl) {
Expand Down
Loading