Skip to content
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
876 changes: 413 additions & 463 deletions dist/index.js

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions src/action/cli/summary.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/analysis/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export async function clientAnalysis(): Promise<Verdict> {

const verdict: Verdict = {
passed: true,
message: '',
errorList: [],
warningList: []
message: ''
};

// if no changed files are found, return early
Expand All @@ -22,9 +20,6 @@ export async function clientAnalysis(): Promise<Verdict> {

const analysis = await runTicsAnalyzer(changedFiles.path);

verdict.errorList = analysis.errorList;
verdict.warningList = analysis.warningList;

let failedMessage: string;
if (analysis.explorerUrls.length === 0) {
failedMessage = await processIncompleteAnalysis(analysis);
Expand Down
4 changes: 1 addition & 3 deletions src/analysis/diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export async function diagnosticAnalysis(): Promise<Verdict> {

return {
passed: passed,
message: !passed ? 'Diagnostic run has failed.' : '',
errorList: analysis.errorList,
warningList: analysis.warningList
message: !passed ? 'Diagnostic run has failed.' : ''
};
}
4 changes: 1 addition & 3 deletions src/analysis/qserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export async function qServerAnalysis(): Promise<Verdict> {

const verdict: Verdict = {
passed: analysis.completed && analysis.statusCode === 0 && newDate !== oldDate,
message: '',
errorList: analysis.errorList,
warningList: analysis.warningList
message: ''
};

if (!verdict.passed) {
Expand Down
2 changes: 0 additions & 2 deletions src/helper/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export interface ChangedFiles {
export interface Verdict {
passed: boolean;
message: string;
errorList: string[];
warningList: string[];
}

export interface Analysis {
Expand Down
3 changes: 0 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Mode } from './configuration/tics';
import { existsSync } from 'fs';
import { logger } from './helper/logger';
import { githubConfig, ticsCli, ticsConfig } from './configuration/config';
import { postCliSummary } from './action/cli/summary';
import { summary } from '@actions/core';
import { Verdict } from './helper/interfaces';
import { uploadArtifact } from './github/artifacts';
Expand Down Expand Up @@ -44,8 +43,6 @@ export async function main(): Promise<void> {
logger.setFailed(verdict.message);
}

postCliSummary(verdict);

// Write the summary made to the action summary.
await summary.write({ overwrite: true });
}
Expand Down
43 changes: 0 additions & 43 deletions test/unit/action/cli/summary.test.ts

This file was deleted.

20 changes: 5 additions & 15 deletions test/unit/analysis/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ describe('setFailed checks (TICS Client)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: [],
warningList: []
message: ''
});
expect(spyInfo).toHaveBeenCalledWith(expect.stringContaining('No changed files found to analyze.'));
});
Expand All @@ -54,9 +52,7 @@ describe('setFailed checks (TICS Client)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Failed to complete TICS analysis.',
errorList: ['Error'],
warningList: []
message: 'Failed to complete TICS analysis.'
});
});

Expand All @@ -69,9 +65,7 @@ describe('setFailed checks (TICS Client)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: ['Error'],
warningList: []
message: ''
});
});

Expand All @@ -84,9 +78,7 @@ describe('setFailed checks (TICS Client)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Failed to complete TICS analysis.',
errorList: [],
warningList: ['Warning']
message: 'Failed to complete TICS analysis.'
});
});

Expand All @@ -99,9 +91,7 @@ describe('setFailed checks (TICS Client)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: [],
warningList: ['Warning']
message: ''
});
});
});
8 changes: 2 additions & 6 deletions test/unit/analysis/diagnostic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ describe('diagnostic mode checks', () => {
expect(spyAnalyzer).toHaveBeenCalledTimes(1);
expect(verdict).toMatchObject({
passed: true,
message: '',
errorList: analysisPassed.errorList,
warningList: analysisPassed.warningList
message: ''
});
});

Expand All @@ -46,9 +44,7 @@ describe('diagnostic mode checks', () => {
expect(spyAnalyzer).toHaveBeenCalledTimes(1);
expect(verdict).toMatchObject({
passed: false,
message: 'Diagnostic run has failed.',
errorList: analysisFailed.errorList,
warningList: analysisFailed.warningList
message: 'Diagnostic run has failed.'
});
});
});
36 changes: 9 additions & 27 deletions test/unit/analysis/qserver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Failed to complete TICSQServer analysis.',
errorList: ['Error'],
warningList: []
message: 'Failed to complete TICSQServer analysis.'
});
});

Expand All @@ -69,9 +67,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Failed to complete TICSQServer analysis.',
errorList: ['Error'],
warningList: []
message: 'Failed to complete TICSQServer analysis.'
});
});

Expand All @@ -84,9 +80,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Failed to complete TICSQServer analysis.',
errorList: [],
warningList: ['Warning']
message: 'Failed to complete TICSQServer analysis.'
});
});

Expand All @@ -99,9 +93,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: [],
warningList: ['[WARNING 5057]']
message: ''
});
expect(spyPostToConversation).not.toHaveBeenCalled();

Expand All @@ -112,9 +104,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: [],
warningList: ['[WARNING 5057]']
message: ''
});
expect(spyPostToConversation).toHaveBeenCalled();
});
Expand All @@ -129,9 +119,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'error',
errorList: [],
warningList: ['Warning']
message: 'error'
});
});

Expand All @@ -145,9 +133,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Something went wrong: reason unknown',
errorList: [],
warningList: ['Warning']
message: 'Something went wrong: reason unknown'
});
});

Expand All @@ -161,9 +147,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: false,
message: 'Project failed quality gate',
errorList: [],
warningList: ['Warning']
message: 'Project failed quality gate'
});
});

Expand All @@ -178,9 +162,7 @@ describe('setFailed checks (QServer)', () => {

expect(verdict).toEqual({
passed: true,
message: '',
errorList: [],
warningList: ['Warning']
message: ''
});
});
});
Loading
Loading