terascope / teraslice

Scalable data processing pipelines in JavaScript
https://terascope.github.io/teraslice/
Apache License 2.0
50 stars 13 forks source link

Make test runner asset aware #3413

Closed busma13 closed 1 year ago

busma13 commented 1 year ago

Update TS-scripts test to be able to find all of the test directories within an asset repository without modifying the workspaces array in the root package.json.

TS-scripts test was originally written to run on Teraslice. When it started being used on assets, it could not find the asset's test directory because it is located at the root of the repository, not in the /asset directory. The workaround currently is to add "." to the workspaces array in the root package.json. If the test runner knows it is in an asset, it can find the proper test directories in a more direct manner.

While updating bump.ts to run on assets, we had to include a workaround to filter out the "." when using the workspaces array, as it would throw a path not found exception. ref: https://github.com/terascope/teraslice/pull/3408/files#r1326211407

sotojn commented 1 year ago

I made a change to packages/scripts/src/helpers/test-runner/index.ts inside of the runTests function that detects if test command is being ran inside of an asset. If so, it will add the top level package into the packaged list to trigger the top level tests folder within the asset.

refeference to diff here

sotojn commented 1 year ago

Also it is important to remove the . inside workspaces within the top level package.json inside of the asset you are trying to run tests on.

Lastly you need to add "testSuite": "none" inside the terascope object within all package.json files that don't already have it or else the -s flag will not work.

refs to changes here

godber commented 1 year ago

This is all done, right?

busma13 commented 1 year ago

Yes it is.