Skip to content

Commit 18d1f57

Browse files
authored
Get rid of dotnet test runner (#32834)
1 parent 4561b1e commit 18d1f57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2598
-1763
lines changed

.github/actions/run-qunit-tests/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ runs:
8686
shell: bash
8787
run: pnpm install
8888

89-
- name: Build dotnet
90-
working-directory: ./packages/devextreme
91-
shell: bash
92-
run: dotnet build build/build-dotnet.sln
93-
9489
- name: Run QUnit tests
9590
working-directory: ./packages/devextreme
9691
shell: bash

.github/workflows/qunit_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ jobs:
6969
working-directory: ./packages/devextreme
7070
env:
7171
DEVEXTREME_TEST_CI: "true"
72-
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
73-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "true"
7472
BUILD_INPROGRESS_RENOVATION: "true"
7573
run: pnpx nx build:systemjs
7674

packages/devextreme/build/build-dotnet.sln

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/devextreme/docker-ci.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# 1. GITHUBACTION=true (GitHub Actions)
88
# - Runs NATIVELY on GitHub runner (NO Docker container!)
9-
# - Uses pre-installed Chrome and dotnet
9+
# - Uses pre-installed Chrome and Node.js
1010
# - Dependencies already installed by workflow
1111
# - Fastest and most stable mode
1212
#
@@ -79,8 +79,11 @@ function run_test_impl {
7979
pnpm run build
8080
fi
8181

82-
echo "Starting ASP.NET Core test runner..."
83-
dotnet ./testing/runner/bin/runner.dll --single-run & runner_pid=$!
82+
echo "Compiling TypeScript test runner..."
83+
pnpm exec tsc -p ./testing/runner/tsconfig.json
84+
85+
echo "Starting Node.js test runner..."
86+
node ./testing/runner/dist/index.js --single-run & runner_pid=$!
8487
echo "Runner PID: $runner_pid"
8588

8689
local max_attempts=30
@@ -241,7 +244,7 @@ function start_runner_watchdog {
241244
echo "Watchdog running in background (PID: $watchdog_pid)"
242245
}
243246

244-
echo "node $(node -v), pnpm $(pnpm -v), dotnet $(dotnet --version)"
247+
echo "node $(node -v), pnpm $(pnpm -v)"
245248

246249
TARGET_FUNC="run_$TARGET"
247250

packages/devextreme/eslint.config.mjs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import i18N from 'eslint-plugin-i18n';
44
import babelParser from '@babel/eslint-parser';
55
import tsParser from '@typescript-eslint/parser';
66
import path from 'node:path';
7+
import { createRequire } from 'node:module';
78
import { fileURLToPath } from 'node:url';
89
import js from '@eslint/js';
910
import { FlatCompat } from '@eslint/eslintrc';
@@ -17,12 +18,32 @@ import customRules from './eslint_plugins/index.js';
1718

1819
const __filename = fileURLToPath(import.meta.url);
1920
const __dirname = path.dirname(__filename);
21+
const require = createRequire(import.meta.url);
2022
const compat = new FlatCompat({
2123
baseDirectory: __dirname,
2224
recommendedConfig: js.configs.recommended,
2325
allConfig: js.configs.all
2426
});
2527

28+
function loadDevExtremeConfig(moduleName, legacyName) {
29+
try {
30+
const loadedModule = require(moduleName);
31+
const normalized = loadedModule.default ?? loadedModule;
32+
33+
if (Array.isArray(normalized)) {
34+
return normalized;
35+
}
36+
37+
return compat.config(normalized);
38+
} catch {
39+
return compat.extends(legacyName);
40+
}
41+
}
42+
43+
const spellCheckConfig = loadDevExtremeConfig('eslint-config-devextreme/spell-check', 'devextreme/spell-check');
44+
const typescriptConfig = loadDevExtremeConfig('eslint-config-devextreme/typescript', 'devextreme/typescript');
45+
const qunitConfig = loadDevExtremeConfig('eslint-config-devextreme/qunit', 'devextreme/qunit');
46+
2647
export default [
2748
{
2849
ignores: [
@@ -43,7 +64,7 @@ export default [
4364
'js/common/core/localization/default_messages.js',
4465
],
4566
},
46-
...compat.extends('devextreme/spell-check'),
67+
...spellCheckConfig,
4768
{
4869
plugins: {
4970
'no-only-tests': noOnlyTests,
@@ -173,7 +194,7 @@ export default [
173194
'import': importPlugin,
174195
}
175196
},
176-
...compat.extends('devextreme/typescript').map(config => {
197+
...typescriptConfig.map(config => {
177198
const newConfig = {
178199
...config,
179200
files: ['**/*.ts?(x)'],
@@ -219,7 +240,7 @@ export default [
219240
}],
220241
},
221242
},
222-
...compat.extends('devextreme/typescript').map(config => {
243+
...typescriptConfig.map(config => {
223244
const newConfig = {
224245
...config,
225246
files: ['**/*.d.ts'],
@@ -259,7 +280,7 @@ export default [
259280
}
260281
},
261282
// Rules for QUnit tests
262-
...compat.extends('devextreme/qunit').map(config => ({
283+
...qunitConfig.map(config => ({
263284
...config,
264285
files: ['testing/tests/**/*.js', 'testing/helpers/**/*.js'],
265286
})),

packages/devextreme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
"build:testing-playground": "gulp build-renovation-testing:watch --playgroundName",
239239
"build:community-localization": "gulp generate-community-locales",
240240
"build:systemjs": "gulp transpile-systemjs",
241-
"dev": "dotnet build build/build-dotnet.sln && cross-env DEVEXTREME_TEST_CI=true gulp dev",
241+
"dev": "cross-env DEVEXTREME_TEST_CI=true gulp dev",
242242
"dev:watch": "cross-env DEVEXTREME_TEST_CI=true gulp dev-watch",
243243
"transpile-tests": "gulp transpile-tests",
244244
"update-ts-reexports": "dx-tools generate-reexports --sources ./js --exclude \"((dialog|export|list_light|notify|overlay|palette|set_template_engine|splitter_control|themes|themes_callback|track_bar|utils|validation_engine|validation_message)[.d.ts])\" --compiler-options \"{ \\\"typeRoots\\\": [] }\"",

packages/devextreme/project.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@
4949
"^build"
5050
],
5151
"inputs": [
52-
{ "env": "BUILD_TEST_INTERNAL_PACKAGE" },
53-
{ "env": "DEVEXTREME_TEST_CI" },
54-
{ "env": "DOTNET_CLI_TELEMETRY_OPTOUT" },
55-
{ "env": "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" },
52+
{
53+
"env": "BUILD_TEST_INTERNAL_PACKAGE"
54+
},
55+
{
56+
"env": "DEVEXTREME_TEST_CI"
57+
},
5658
"default",
5759
"test"
5860
],

packages/devextreme/testing/launch

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const http = require('http');
44
const { join } = require('path');
5-
const { spawn } = require('child_process');
5+
const { spawn, spawnSync } = require('child_process');
66
const { platform } = require('os');
77
const { env, versions } = require('process');
88
const PORT = require('./../ports.json').qunit;
@@ -14,9 +14,19 @@ if(parseInt(versions.node.split('.')[0]) < 6) {
1414
execRunner();
1515

1616
function execRunner () {
17+
const tscResult = spawnSync(
18+
'pnpm',
19+
[ 'exec', 'tsc', '-p', join(__dirname, 'runner/tsconfig.json') ],
20+
{ stdio: 'inherit', shell: true }
21+
);
22+
23+
if(tscResult.status !== 0) {
24+
throw 'Failed to compile testing runner';
25+
}
26+
1727
spawn(
18-
'dotnet',
19-
[ join(__dirname, 'runner/bin/runner.dll') ],
28+
'node',
29+
[ join(__dirname, 'runner/dist/index.js') ],
2030
{ stdio: 'inherit', shell: true }
2131
);
2232

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vs
22
launchSettings.json
33
*.user
4+
dist

packages/devextreme/testing/runner/.vscode/launch.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)