Issue Bug Closed

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

Jonas Eberle 09/14/21, 17:33 updated 09/16/21, 17:49

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

Reviews 1