Project

General

Profile

Actions

Bug #95216

closed

runTests.sh behaves different than the package.json "script" commands

Added by Jonas Eberle about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Tests
Target version:
-
Start date:
2021-09-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In the contribution workflow we promote using `yarn build-...` which is a shorthand for using the defined commands in package.json "script" section (https://github.com/TYPO3/typo3/blob/master/Build/package.json#L72-L80).

runTests.sh provides the commands `buildJavascript`/`buildCss`, too.

In the case of `buildJavascript` this produces slightly differently minified output to `yarn build-js` (for example a `;` somewhere instead of a `,`).

The called commands are:

./node_modules/.bin/grunt scripts        # cd Build && yarn install && yarn build-js
./node_modules/grunt/bin/grunt scripts   # Build/Scripts/runTests.sh -s buildJavascript

I'd propose to use the commands from the package.json via yarn in runTests.sh, too.

I would also take the opportunity to coerce them into one command/"suite" with arguments, too if technically possible. (E.g. `Build/Scripts/runTests.sh -s yarn build-css`). That should make it less complex to understand where they come from and what they do.

It appears that the `Build/Scripts/runTests.sh -s build*` commands are currently not part of the CI https://github.com/TYPO3/typo3/tree/master/Build/gitlab-ci - I would suggest to add them to check for correct builds.

Ref:
https://docs.typo3.org/m/typo3/guide-contributionworkflow/master/en-us/Setup/SetupTypo3.html#yarn-tasks

Actions #1

Updated by Jonas Eberle about 3 years ago

Hm, `./node_modules/.bin/grunt scripts` is just a symlink... Still it produces reproducibly the same, but different output than the other command.

Actions #2

Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71086

Actions #3

Updated by Jonas Eberle about 3 years ago

There are other commands in runTests.sh that use the node stack. It would make sense IMHO to get them all under the "yarn" umbrella.

checkGruntclean -> check_grunt_clean -> node_modules/grunt/bin/grunt build
lintScss -> lint_scss -> node_modules/grunt/bin/grunt stylelint
lintHtml -> lint_html -> node_modules/grunt/bin/grunt lintspaces
lintTypescript -> lint_typescript -> node_modules/grunt/bin/grunt eslint
unitJavascript -> unit_javascript -> Build/node_modules/karma/bin/karma start vendor/typo3/testing-framework/Resources/Core/Build/Configuration/JSUnit/karma.conf.ci.js --single-run
Actions #4

Updated by Jonas Eberle about 3 years ago

  • Status changed from Under Review to Closed
Actions

Also available in: Atom PDF