Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit a8eb54e

Browse files
fix: generating dist/index.js prior, regenerated yarn.lock (#5)
1 parent 844f4ab commit a8eb54e

File tree

4 files changed

+112
-25
lines changed

4 files changed

+112
-25
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
node_modules/
2-
dist/
1+
node_modules/

action.yaml

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ inputs:
1515
required: true
1616
repoName:
1717
description: "Name of the repository to checkout ('org/repo')"
18+
required: false
1819
repoRef:
1920
description: "Tag, Branch, or Commit SHA for the Test Suite repository"
2021
default: "main"
22+
required: false
2123
simulationClass:
2224
description: "Full classpath of the simulation to run"
25+
required: false
2326
runs:
2427
using: "composite"
2528
steps:
@@ -36,13 +39,8 @@ runs:
3639
with:
3740
distribution: ${{ inputs.javaDistribution }}
3841
java-version: ${{ inputs.javaVersion }}
39-
- run: mvn -f ${{ inputs.testPath }} gatling:test ${{ inputs.simulationClass != '' && '-Dgatling.simulationClass=' || '' }}${{ inputs.simulationClass }}
40-
shell: bash
4142

42-
- uses: actions/setup-node@v3
43-
with:
44-
node-version: '16'
45-
- run: yarn install && yarn run build
43+
- run: mvn -f ${{ inputs.testPath }} gatling:test ${{ inputs.simulationClass != '' && '-Dgatling.simulationClass=' || '' }}${{ inputs.simulationClass }}
4644
shell: bash
4745

4846
- name: Generate Job Summary

dist/index.js

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/******/ (() => { // webpackBootstrap
2+
/******/ var __webpack_modules__ = ({
3+
4+
/***/ 932:
5+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6+
7+
const fs = __nccwpck_require__(147);
8+
9+
module.exports = async ({github, context, core}) => {
10+
const testPath = process.env.TEST_PATH
11+
const lastRuns = fs.readFileSync(`${testPath}/target/gatling/lastRun.txt`).toString().trim().split('\n');
12+
13+
for(const run of lastRuns) {
14+
const results = JSON.parse(fs.readFileSync(`${testPath}/target/gatling/${run}/js/stats.json`).toString());
15+
let tableContent = [
16+
[
17+
{data: 'Request', header: true},
18+
{data: 'Success ✅', header: true},
19+
{data: 'Errors ❌', header: true},
20+
{data: 'Min', header: true},
21+
{data: 'Max', header: true},
22+
{data: 'Avg.', header: true},
23+
{data: 'Std. Dev.', header: true},
24+
{data: 'RPS', header: true},
25+
]
26+
];
27+
28+
for(const result in results.contents) {
29+
const requestMetrics = results.contents[result].stats;
30+
tableContent.push([
31+
requestMetrics.name,
32+
requestMetrics.numberOfRequests.ok.toString(),
33+
requestMetrics.numberOfRequests.ko.toString(),
34+
requestMetrics.minResponseTime.total.toString(),
35+
requestMetrics.maxResponseTime.total.toString(),
36+
requestMetrics.meanResponseTime.total.toString(),
37+
requestMetrics.standardDeviation.total.toString(),
38+
requestMetrics.meanNumberOfRequestsPerSecond.total.toString(),
39+
]);
40+
}
41+
42+
await core.summary
43+
.addHeading(`Results for ${run}`)
44+
.addTable(tableContent)
45+
.addQuote('All times are in millisecond (ms). RPS means "Requests per Second"')
46+
.write()
47+
}
48+
}
49+
50+
51+
/***/ }),
52+
53+
/***/ 147:
54+
/***/ ((module) => {
55+
56+
"use strict";
57+
module.exports = require("fs");
58+
59+
/***/ })
60+
61+
/******/ });
62+
/************************************************************************/
63+
/******/ // The module cache
64+
/******/ var __webpack_module_cache__ = {};
65+
/******/
66+
/******/ // The require function
67+
/******/ function __nccwpck_require__(moduleId) {
68+
/******/ // Check if module is in cache
69+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
70+
/******/ if (cachedModule !== undefined) {
71+
/******/ return cachedModule.exports;
72+
/******/ }
73+
/******/ // Create a new module (and put it into the cache)
74+
/******/ var module = __webpack_module_cache__[moduleId] = {
75+
/******/ // no module.id needed
76+
/******/ // no module.loaded needed
77+
/******/ exports: {}
78+
/******/ };
79+
/******/
80+
/******/ // Execute the module function
81+
/******/ var threw = true;
82+
/******/ try {
83+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
84+
/******/ threw = false;
85+
/******/ } finally {
86+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
87+
/******/ }
88+
/******/
89+
/******/ // Return the exports of the module
90+
/******/ return module.exports;
91+
/******/ }
92+
/******/
93+
/************************************************************************/
94+
/******/ /* webpack/runtime/compat */
95+
/******/
96+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
97+
/******/
98+
/************************************************************************/
99+
/******/
100+
/******/ // startup
101+
/******/ // Load entry module and return exports
102+
/******/ // This entry module is referenced by other modules so it can't be inlined
103+
/******/ var __webpack_exports__ = __nccwpck_require__(932);
104+
/******/ module.exports = __webpack_exports__;
105+
/******/
106+
/******/ })()
107+
;

yarn.lock

-17
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
# yarn lockfile v1
33

44

5-
"@actions/core@^1.8.0":
6-
version "1.8.1"
7-
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.8.1.tgz#3cdde366654b98764e63633a08dba6703131e274"
8-
integrity sha512-LuFg2O/+rRrYxrdafnqH9mx6ADszKzQAhDuEhhMQIh47tsXzWkW4wXY5zvscqJ4KDywyJX0LA0pAESPLUjZXvw==
9-
dependencies:
10-
"@actions/http-client" "^2.0.0"
11-
12-
"@actions/http-client@^2.0.0":
13-
version "2.0.0"
14-
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.0.0.tgz#518c4af1e7045769d3e2ad8c2ce7f8b05224a9b3"
15-
integrity sha512-fm1+OPPey5ypgStT9K8zbBhICj4J4UV/TJIHDhuWlkb8KyJaAtjcZK184dTqul0dV0nPKX97FNtDXX20BTLXSA==
16-
175
"@babel/code-frame@^7.0.0":
186
version "7.16.7"
197
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789"
@@ -3118,11 +3106,6 @@ trim-newlines@^3.0.0:
31183106
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
31193107
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==
31203108

3121-
tunnel@^0.0.6:
3122-
version "0.0.6"
3123-
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
3124-
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
3125-
31263109
type-fest@^0.16.0:
31273110
version "0.16.0"
31283111
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860"

0 commit comments

Comments
 (0)