Skip to content

Commit

Permalink
Update the build config actions versions
Browse files Browse the repository at this point in the history
- run the tests for build
- correct the data test files
- normalize jsons inside the tests
  • Loading branch information
ClaudiaGivan committed May 27, 2024
1 parent ab4ac53 commit 04a2ca8
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 99 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: Lint and Prettier Check
name: Automated tests
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '14'
node-version: '20'

- name: Install Dependencies
run: npm ci

- name: Run linter
run: npm run check

- name: Run tests
run: npm run test
70 changes: 35 additions & 35 deletions examples/exampleData.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1680020338",
"work_id": "TRON-12876"
"work_id": "T-71828811"
},
{
"analysis_active": "1680804888",
Expand All @@ -29,7 +29,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1681136974",
"work_id": "TRON-12964"
"work_id": "T-718289222"
},
{
"analysis_active": null,
Expand All @@ -45,7 +45,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": null,
"work_id": "TRON-14596"
"work_id": "T-71848596"
},
{
"analysis_active": null,
Expand All @@ -59,7 +59,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1686577654",
"work_id": "TRON-14861"
"work_id": "T-71848861"
},
{
"analysis_active": "1681811131",
Expand All @@ -73,7 +73,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1686237182",
"work_id": "TRON-14053"
"work_id": "T-71848053"
}],
"spell-parsers-config":
[
Expand All @@ -91,7 +91,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": null,
"work_id": "TRON-14302"
"work_id": "T-71848302"
},
{
"analysis_active": "1675779343",
Expand All @@ -105,7 +105,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1679411370",
"work_id": "TRON-13136"
"work_id": "T-71838136"
},
{
"analysis_active": "1682607207",
Expand All @@ -119,7 +119,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": null,
"work_id": "TRON-14201"
"work_id": "T-71848201"
},
{
"analysis_active": null,
Expand All @@ -133,7 +133,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680780363",
"work_id": "TRON-13873"
"work_id": "T-71838873"
},
{
"analysis_active": "1680527698",
Expand All @@ -147,7 +147,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680700337",
"work_id": "TRON-13832"
"work_id": "T-71838832"
},
{
"analysis_active": null,
Expand All @@ -161,7 +161,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680621963",
"work_id": "TRON-13806"
"work_id": "T-71838806"
},
{
"analysis_active": null,
Expand All @@ -175,7 +175,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1686305608",
"work_id": "TRON-14832"
"work_id": "T-71848832"
},
{
"analysis_active": "1680608881",
Expand All @@ -189,7 +189,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680620673",
"work_id": "TRON-13847"
"work_id": "T-71838847"
},
{
"analysis_active": null,
Expand All @@ -207,7 +207,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1675344450",
"work_id": "TRON-11811"
"work_id": "T-71818811"
},
{
"analysis_active": null,
Expand All @@ -225,7 +225,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1670337266",
"work_id": "TRON-12110"
"work_id": "T-71828110"
},
{
"analysis_active": "1677509505",
Expand All @@ -241,7 +241,7 @@ export const exampleData = {
"name": "service", "value": "spells-tools"
}],
"verification_start": "1677509809",
"work_id": "TRON-13463"
"work_id": "T-71838463"
},
{
"analysis_active": null,
Expand All @@ -255,7 +255,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1687391647",
"work_id": "TRON-15033"
"work_id": "T-71858033"
},
{
"analysis_active": null,
Expand All @@ -269,7 +269,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1683699264",
"work_id": "TRON-14417"
"work_id": "T-71848417"
},
{
"analysis_active": null,
Expand All @@ -283,7 +283,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": null,
"work_id": "TRON-11830"
"work_id": "T-71818830"
},
{
"analysis_active": null,
Expand All @@ -297,7 +297,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680708485",
"work_id": "TRON-13870"
"work_id": "T-71838870"
},
{
"analysis_active": "1680537948",
Expand All @@ -311,7 +311,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680608417",
"work_id": "TRON-13844"
"work_id": "T-71838844"
}
],
"wizard-lambda":
Expand All @@ -330,7 +330,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1675087145",
"work_id": "TRON-12070"
"work_id": "T-71828070"
},
{
"analysis_active": null,
Expand All @@ -344,7 +344,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1675777005",
"work_id": "TRON-13130"
"work_id": "T-71838130"
},
{
"analysis_active": null,
Expand All @@ -360,7 +360,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1675087145",
"work_id": "TRON-11017"
"work_id": "T-71818017"
},
{
"analysis_active": null,
Expand All @@ -374,7 +374,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680792708",
"work_id": "TRON-13885"
"work_id": "T-71838885"
},
{
"analysis_active": null,
Expand All @@ -390,7 +390,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": "1673890621",
"work_id": "TRON-12515"
"work_id": "T-71828515"
},
{
"analysis_active": null,
Expand All @@ -406,7 +406,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": null,
"work_id": "TRON-10784"
"work_id": "T-71808784"
},
{
"analysis_active": null,
Expand All @@ -420,7 +420,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1680089356",
"work_id": "TRON-13782"
"work_id": "T-71838782"
},
{
"analysis_active": null,
Expand All @@ -434,7 +434,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1683699333",
"work_id": "TRON-14418"
"work_id": "T-71848418"
},
{
"analysis_active": null,
Expand All @@ -446,7 +446,7 @@ export const exampleData = {
"indexes": [],
"tags": [],
"verification_start": "1669910344",
"work_id": "TRON-12475"
"work_id": "T-71828475"
},
{
"analysis_active": "1675698235",
Expand All @@ -460,7 +460,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1675947092",
"work_id": "TRON-13140"
"work_id": "T-71838140"
},
{
"analysis_active": null,
Expand All @@ -474,7 +474,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": null,
"work_id": "TRON-11179"
"work_id": "T-71818179"
},
{
"analysis_active": null,
Expand All @@ -488,7 +488,7 @@ export const exampleData = {
}],
"tags": [],
"verification_start": "1675687597",
"work_id": "TRON-12016"
"work_id": "T-71828016"
},
{
"analysis_active": null,
Expand All @@ -504,7 +504,7 @@ export const exampleData = {
"name": "service", "value": "parser-infrastructure"
}],
"verification_start": null,
"work_id": "TRON-10868"
"work_id": "T-71808868"
},
{
"analysis_active": null,
Expand All @@ -518,7 +518,7 @@ export const exampleData = {
"name": "service", "value": "wizard-request"
}],
"verification_start": null,
"work_id": "TRON-12457"
"work_id": "T-71828457"
}
]
}
2 changes: 1 addition & 1 deletion src/data-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* "indexes": [],
* "tags": [],
* "verification_start": "timestamp",
* "work_id": "TRON-number"
* "work_id": "Ticket-number"
* }
* ]
* }
Expand Down
2 changes: 1 addition & 1 deletion src/graphs/cfd/CFDGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CFDGraph {
* "indexes": [],
* "tags": [],
* "verification_start": "timestamp",
* "work_id": "TRON-number"
* "work_id": "Ticket-number"
* }
* ];
*/
Expand Down
5 changes: 3 additions & 2 deletions src/graphs/cfd/CFDRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ class CFDRenderer extends UIControlsRenderer {
*/
computeMetrics(currentDate, currentCumulativeCount, excludeCycleTime = false) {
currentDate = new Date(currentDate);
currentDate.setHours(0, 0, 0, 0);
currentDate.setUTCHours(0, 0, 0, 0);
const currentDataEntry = this.data.find((d) => areDatesEqual(new Date(d.date), currentDate));
if (currentDataEntry) {
const filteredData = this.data.filter((d) => d.date <= currentDate).reverse();
Expand All @@ -605,7 +605,8 @@ class CFDRenderer extends UIControlsRenderer {
const noOfItemsAfter = this.#getNoOfItems(currentDataEntry, this.states[this.states.indexOf('analysis_active')]);

const wip = noOfItemsAfter - noOfItemsBefore;
const throughput = averageLeadTime ? parseFloat((wip / averageLeadTime).toFixed(1)) : undefined;
const throughput = averageLeadTime ? parseFloat((averageLeadTime / wip).toFixed(1)) : undefined;

excludeCycleTime && (averageCycleTime = null);
return {
currentState: this.states[currentStateIndex],
Expand Down
2 changes: 1 addition & 1 deletion src/graphs/histogram/HistogramRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HistogramRenderer extends Renderer {
* {
* "delivered": "2023-01-09T15:12:03.000Z",
* "noOfDays": 3,
* "ticketId": "TRON-12349"
* "ticketId": "T-9128349"
* }
* ];
* @param {Object} eventBus - event bus object for communicating with the other graphs through events
Expand Down
Loading

0 comments on commit 04a2ca8

Please sign in to comment.