Skip to content

Commit

Permalink
Merge branch 'main' into feat-namespace-filter-and-group
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecotter committed Jan 10, 2024
2 parents ae1b1f2 + 9691945 commit 9e2765a
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 137 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ jobs:
echo "Publish to vsce
vsix name: $pkgPath"
vsce publish --packagePath ${pkgPath} --no-dependencies --pre-release -p ${{ secrets.VSCE_TOKEN }} --skip-duplicate
vsce publish --packagePath ${pkgPath} --no-dependencies --pre-release --skip-duplicate -p ${{ secrets.VSCE_TOKEN }}
echo "
Publish to ovsx"
ovsx publish ${pkgPath} --no-dependencies --pre-release -p ${{ secrets.OVSX_TOKEN }} --skip-duplicate
ovsx publish ${pkgPath} --no-dependencies --pre-release --skip-duplicate -p ${{ secrets.OVSX_TOKEN }}
- name: Update pre-release tag
run: |
echo "Updating pre release tag"
Expand Down
56 changes: 21 additions & 35 deletions log-viewer/modules/__tests__/ApexLogParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ import {
TimedNode,
lineTypeMap,
parse,
parseLineNumber,
parseObjectNamespace,
parseRows,
parseTimestamp,
parseVfNamespace,
} from '../parsers/ApexLogParser.js';

Expand Down Expand Up @@ -43,18 +41,6 @@ describe('parseVfNamespace tests', () => {
});
});

describe('parseTimestamp tests', () => {
it("Should parse the timestamp from it's section", () => {
expect(parseTimestamp('22:00:05.0 (59752074)')).toEqual(59752074);
});
});

describe('parseLineNumber tests', () => {
it("Should parse the line-number from it's section", () => {
expect(parseLineNumber('[37]')).toEqual(37);
});
});

describe('parseRows tests', () => {
it("Should parse the row-count from it's section", () => {
expect(parseRows('Rows:12')).toEqual(12);
Expand Down Expand Up @@ -93,20 +79,32 @@ describe('Pseudo EXIT events', () => {
expect(log1.duration).toEqual({ self: 0, total: 3 });

const approval1 = log1.children[0] as Method;
expect(approval1.duration).toEqual({ self: 1, total: 1 });
expect(approval1.type).toEqual('WF_APPROVAL_SUBMIT');
expect(approval1).toMatchObject({
type: 'WF_APPROVAL_SUBMIT',
timestamp: 1,
duration: { self: 1, total: 1 },
});

const processFound1 = log1.children[1] as Method;
expect(processFound1.duration).toEqual({ self: 1, total: 1 });
expect(processFound1.type).toEqual('WF_PROCESS_FOUND');
expect(processFound1).toMatchObject({
type: 'WF_PROCESS_FOUND',
timestamp: 2,
duration: { self: 1, total: 1 },
});

const approval2 = log1.children[2] as Method;
expect(approval2.duration).toEqual({ self: 1, total: 1 });
expect(approval2.type).toEqual('WF_APPROVAL_SUBMIT');
expect(approval2).toMatchObject({
type: 'WF_APPROVAL_SUBMIT',
timestamp: 3,
duration: { self: 1, total: 1 },
});

const processFound2 = log1.children[3] as Method;
expect(processFound2.duration).toEqual({ self: 0, total: 0 }); // no lines after the last WF_PROCESS_FOUND to use as an exit
expect(processFound2.type).toEqual('WF_PROCESS_FOUND');
expect(processFound2).toMatchObject({
type: 'WF_PROCESS_FOUND',
timestamp: 4,
duration: { self: 0, total: 0 }, // no lines after the last WF_PROCESS_FOUND to use as an exit
});
});

it('Pseudo EXIT With Entry after last event', () => {
Expand Down Expand Up @@ -1086,21 +1084,9 @@ describe('Recalculate durations tests', () => {
node.exitStamp = 3;

node.recalculateDurations();
expect(node.timestamp).toEqual(1);
expect(node.duration).toEqual({ self: 2, total: 2 });
});

it('Children are subtracted from net duration', () => {
const node = new Method(['14:32:07.563 (0)', 'DUMMY'], [], 'Method', ''),
child1 = new Method(['14:32:07.563 (10)', 'DUMMY'], [], 'Method', ''),
child2 = new Method(['14:32:07.563 (70)', 'DUMMY'], [], 'Method', '');
node.exitStamp = 100;
child1.duration.total = 50;
child2.duration.total = 25;
node.addChild(child1);
node.addChild(child2);
node.recalculateDurations();
expect(node.duration).toEqual({ self: 25, total: 100 });
});
});

describe('Line Type Tests', () => {
Expand Down
Loading

0 comments on commit 9e2765a

Please sign in to comment.