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: optimise build and coverage #2985

Merged
merged 6 commits into from
Jan 10, 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Report Code Coverage
name: DT Tests
on:
workflow_call:
secrets:
Expand Down Expand Up @@ -30,8 +30,9 @@ jobs:

- name: Run Tests
run: |
npm run test:js:ci
npm run test:ts:ci
# Supress logging in tests
LOG_LEVEL=100 npm run test:js:ci
LOG_LEVEL=100 npm run test:ts:ci

- name: Run Lint Checks
run: |
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/test.yml → .github/workflows/ut-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ on:
- synchronize

jobs:
test:
name: Run Tests
ut_tests:
name: UT Tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.17

- name: Install Latest Version of Kind
run: go install sigs.k8s.io/[email protected]

- name: Checkout
uses: actions/[email protected]
with:
Expand All @@ -26,19 +34,6 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Run Unit Tests
run: |
npm run test:js:ci
npm run test:ts:ci

- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.17

- name: Install Latest Version of Kind
run: go install sigs.k8s.io/[email protected]

- name: Create Kind cluster
run: kind create cluster --name kind-cluster --config=test/__tests__/data/worker-nodes-kind.yml

Expand Down
2 changes: 0 additions & 2 deletions src/adapters/networkHandlerFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ describe(`Network Handler Tests`, () => {
it('Should return v0 handler if v1 version and handler is present for destination in v0', () => {
const { networkHandler, handlerVersion } = getNetworkHandler('braze', `v1`);
const brazeProxy = require(`../v0/destinations/braze/networkHandler`).networkHandler;
console.log(networkHandler);
expect(networkHandler).toEqual(new brazeProxy());
});

it('Should return generic handler', () => {
const { networkHandler, handlerVersion } = getNetworkHandler('abc', `v1`);
const brazeProxy = require(`../v0/destinations/braze/networkHandler`).networkHandler;
console.log(networkHandler);
expect(networkHandler).toEqual(new GenericNetworkHandler());
});
});
2 changes: 0 additions & 2 deletions src/v0/destinations/bqstream/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ describe('getRearrangedEvents', () => {
],
];
const result = getRearrangedEvents(successEventslist, errorEventsList);
console.log(JSON.stringify(result));
expect(result).toEqual(expected);
});

Expand Down Expand Up @@ -261,7 +260,6 @@ describe('getRearrangedEvents', () => {
],
];
const result = getRearrangedEvents(successEventslist, errorEventsList);
console.log(JSON.stringify(result));
expect(result).toEqual(expected);
});
});
1 change: 0 additions & 1 deletion src/v0/destinations/ga4/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ describe('Google Analytics 4 utils test', () => {
const output = validateEventName('Grisly1234567_Open_General_Setting');
expect(output).toEqual();
} catch (error) {
console.log(error.message);
expect(error.message).toEqual();
}
});
Expand Down
1 change: 0 additions & 1 deletion src/v0/destinations/mp/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ describe('Mixpanel utils test', () => {
const setOnceProperties = ['name', 'email'];

const result = trimTraits(traits, contextTraits, setOnceProperties);
console.log(result);

expect(result).toEqual({
traits: {
Expand Down
1 change: 0 additions & 1 deletion src/v0/util/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ describe('Utility Functions Tests', () => {
test.each(funcTestData)('$description', async ({ description, input, output }) => {
try {
let result;
console.log(Object.values(input));
result = utilities[funcName](...Object.values(input));
expect(result).toEqual(output);
} catch (e) {
Expand Down
3 changes: 0 additions & 3 deletions test/__tests__/marketo_bulk_upload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ describe(`${integration} Tests`, () => {
const output = await vRouter.pollStatus(input);
expect(output).toEqual(respPollBody[index]);
} catch (error) {
console.log("CHEEECKKKK");
console.log(error);
console.log(respPollBody[index].error);
expect(error.message).toEqual(respPollBody[index].error);
}
});
Expand Down
1 change: 0 additions & 1 deletion test/__tests__/user_transformation_errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ describe("JS Transformation Error Tests", () => {
true,
);

console.log('XTE: ', result.transformedEvents)
expect(result.transformedEvents.length).toBe(1);
result.transformedEvents.forEach(ev => { expect(ev.error).toEqual(
`ReferenceError: x is not defined
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"exclude": ["./src/**/*.test.js", "./src/**/*.test.ts"],
"exclude": ["./src/**/*.test.js", "./src/**/*.test.ts", "./test"],
"include": ["./src", "./src/**/*.json"]
}
Loading