mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
February major updates (#7443)
- vitest and all test types etc (test pass). Needed a few minor changes to match new behaviour of `expect().toMatchSnapshot` (trailing whitespace is now important) - `which` - read the changes and spot-checked it. They dropped <v18 - `webpack-cli` - changes don't affect our usage. Checked with a local `webpack` build and a "prod" run (`make` no dev) - `enhanced-ms` - checked and updated to use new functionality - `typescript` - all tests pass, no warnings. Tested the site locally too.
This commit is contained in:
10
lib/stats.ts
10
lib/stats.ts
@@ -23,7 +23,7 @@
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import {StorageClass} from '@aws-sdk/client-s3';
|
||||
import ems from 'enhanced-ms';
|
||||
import {createMs, ms} from 'enhanced-ms';
|
||||
|
||||
import {FiledataPair} from '../types/compilation/compilation.interfaces.js';
|
||||
import {CompilerOverrideOptions} from '../types/compilation/compiler-overrides.interfaces.js';
|
||||
@@ -36,6 +36,10 @@ import {PropertyGetter} from './properties.interfaces.js';
|
||||
import {S3Bucket} from './s3-handler.js';
|
||||
import {getHash} from './utils.js';
|
||||
|
||||
const formatMs = createMs({
|
||||
formatOptions: {includedUnits: ['hour', 'minute', 'second', 'millisecond'], useAbbreviations: true},
|
||||
});
|
||||
|
||||
export enum KnownBuildMethod {
|
||||
Compile = 'compile',
|
||||
CMake = 'cmake',
|
||||
@@ -131,7 +135,7 @@ class StatsNoter implements IStatsNoter {
|
||||
this._flushJob = undefined;
|
||||
this._s3 = new S3Bucket(bucket, region ?? 'us-east-1');
|
||||
this._path = path ?? 'compile-stats';
|
||||
logger.info(`Flushing stats to ${bucket}/${this._path} every ${ems(this._flushAfterMs)}`);
|
||||
logger.info(`Flushing stats to ${bucket}/${this._path} every ${formatMs(this._flushAfterMs)}`);
|
||||
}
|
||||
|
||||
private flush() {
|
||||
@@ -178,7 +182,7 @@ export function createStatsNoter(props: PropertyGetter): IStatsNoter {
|
||||
throw new Error(`Bad params: ${config} - expected S3(bucket, path?, region?, flushTime?)`);
|
||||
let durationMs: number | undefined;
|
||||
if (params[3]) {
|
||||
const parsed = ems(params[3]);
|
||||
const parsed = ms(params[3]);
|
||||
if (!parsed)
|
||||
throw new Error(
|
||||
`Bad params: ${config} - expected S3(bucket, path?, region?, flushTime?), bad flush time`,
|
||||
|
||||
1158
package-lock.json
generated
1158
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -38,7 +38,7 @@
|
||||
"compression": "^1.8.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"enhanced-ms": "^3.1.0",
|
||||
"enhanced-ms": "^4.0.0",
|
||||
"events": "^3.3.0",
|
||||
"express": "^4.21.2",
|
||||
"file-saver": "^2.0.5",
|
||||
@@ -78,7 +78,7 @@
|
||||
"underscore": "^1.13.7",
|
||||
"url-join": "^5.0.0",
|
||||
"whatwg-fetch": "^3.6.20",
|
||||
"which": "^4.0.0",
|
||||
"which": "^5.0.0",
|
||||
"winston": "^3.17.0",
|
||||
"winston-loki": "^6.1.3",
|
||||
"winston-papertrail": "^1.0.5",
|
||||
@@ -89,7 +89,7 @@
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@sentry/types": "^8.55.0",
|
||||
"@smithy/util-stream": "^3.3.4",
|
||||
"@smithy/util-stream": "^4.1.2",
|
||||
"@types/bootstrap": "^5.2.10",
|
||||
"@types/chai": "^5.0.1",
|
||||
"@types/compression": "^1.7.5",
|
||||
@@ -110,29 +110,29 @@
|
||||
"@types/webpack-env": "^1.18.8",
|
||||
"@types/which": "^3.0.4",
|
||||
"@types/ws": "^8.5.14",
|
||||
"@vitest/coverage-v8": "^2.1.9",
|
||||
"@vitest/coverage-v8": "^3.0.7",
|
||||
"aws-sdk-client-mock": "^4.1.0",
|
||||
"cheerio": "^1.0.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.0",
|
||||
"cypress": "^13.17.0",
|
||||
"cypress": "^14.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.4.3",
|
||||
"mini-css-extract-plugin": "^2.9.2",
|
||||
"mock-fs": "^5.5.0",
|
||||
"monaco-editor-webpack-plugin": "^7.1.0",
|
||||
"nock": "^13.5.6",
|
||||
"nock": "^14.0.1",
|
||||
"sass": "^1.85.1",
|
||||
"sass-loader": "^16.0.5",
|
||||
"source-map-loader": "^5.0.0",
|
||||
"supertest": "^7.0.0",
|
||||
"terser-webpack-plugin": "^5.3.11",
|
||||
"ts-loader": "^9.5.2",
|
||||
"typescript": "~5.5",
|
||||
"vitest": "^2.1.9",
|
||||
"typescript": "^5.7.3",
|
||||
"vitest": "^3.0.7",
|
||||
"webpack": "^5.98.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"webpack-dev-middleware": "^7.4.2",
|
||||
"webpack-manifest-plugin": "^5.0.0"
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ const recursivelyOrderKeys = (unordered: any): any => {
|
||||
|
||||
const stringifyKeysInOrder = (data: any): string => {
|
||||
const sortedData = recursivelyOrderKeys(data);
|
||||
return JSON.stringify(sortedData, null, ' ');
|
||||
return JSON.stringify(sortedData, null, ' ') + '\n';
|
||||
};
|
||||
|
||||
function testFilter(filename: string, suffix: string, filters: ParseFiltersAndOutputOptions) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"asm": [],
|
||||
"labelDefinitions": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,4 +479,4 @@
|
||||
".L8": 42,
|
||||
"sg_days": 49
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
test/filters-cases/bug-1799.asm.directives.json
generated
2
test/filters-cases/bug-1799.asm.directives.json
generated
@@ -479,4 +479,4 @@
|
||||
".L8": 42,
|
||||
"sg_days": 49
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,4 +394,4 @@
|
||||
".L8": 28,
|
||||
"sg_days": 34
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,4 +417,4 @@
|
||||
".L8": 28,
|
||||
"sg_days": 34
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,4 +394,4 @@
|
||||
".L8": 28,
|
||||
"sg_days": 34
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,4 +394,4 @@
|
||||
".L8": 28,
|
||||
"sg_days": 34
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,4 +479,4 @@
|
||||
".L8": 42,
|
||||
"sg_days": 49
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
test/filters-cases/bug-1799.asm.none.json
generated
2
test/filters-cases/bug-1799.asm.none.json
generated
@@ -780,4 +780,4 @@
|
||||
".L8": 87,
|
||||
"sg_days": 102
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,4 +459,4 @@
|
||||
"$LC0": 2,
|
||||
"main": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
test/filters-cases/bug-660.asm.directives.json
generated
2
test/filters-cases/bug-660.asm.directives.json
generated
@@ -459,4 +459,4 @@
|
||||
"$LC0": 2,
|
||||
"main": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@
|
||||
"$LC0": 1,
|
||||
"main": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,4 +145,4 @@
|
||||
"$LC0": 1,
|
||||
"main": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@
|
||||
"$LC0": 1,
|
||||
"main": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@
|
||||
"$LC0": 1,
|
||||
"main": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,4 +459,4 @@
|
||||
"$LC0": 2,
|
||||
"main": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"asm": [],
|
||||
"labelDefinitions": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
test/filters-cases/bug-7280.asm.directives.json
generated
2
test/filters-cases/bug-7280.asm.directives.json
generated
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@
|
||||
".LC0": 1,
|
||||
"a": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
test/filters-cases/bug-7280.asm.none.json
generated
2
test/filters-cases/bug-7280.asm.none.json
generated
@@ -138,4 +138,4 @@
|
||||
".LC0": 7,
|
||||
"a": 14
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,4 +165,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,4 +165,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,4 +110,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,4 +122,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,4 +110,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,4 +110,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,4 +165,4 @@
|
||||
"labelDefinitions": {
|
||||
"_Z6squarei": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user