Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New asset generator unit test failures #3494

Closed
busma13 opened this issue Dec 11, 2023 · 4 comments
Closed

New asset generator unit test failures #3494

busma13 opened this issue Dec 11, 2023 · 4 comments

Comments

@busma13
Copy link
Contributor

busma13 commented Dec 11, 2023

This is the second time I've seen these two unit tests fail.

 FAIL  packages/teraslice-cli/test/generators/new-asset-spec.ts
  ● new asset generator should › should create the correct asset dir tree and put files in the correct dir

    assert(received)

    Expected value to be equal to:
      true
    Received:
      false
    
    Message:
      /home/runner/work/teraslice/teraslice/packages/teraslice-cli/test/fixtures/generate-new-asset/generated-asset/new_asset/package.json, no such file or directory

      30 |
      31 |     it('should create the correct asset dir tree and put files in the correct dir', () => {
    > 32 |         assert.file([
         |                ^
      33 |             path.join(rootAssetPath, 'package.json'),
      34 |             path.join(rootAssetPath, '.eslintrc'),
      35 |             path.join(rootAssetPath, '.editorconfig'),

      at node_modules/yeoman-assert/index.js:56:12
          at Array.forEach (<anonymous>)
      at Function.Object.<anonymous>.assert.file (node_modules/yeoman-assert/index.js:54:26)
      at Object.<anonymous> (packages/teraslice-cli/test/generators/new-asset-spec.ts:32:16)

  ● new asset generator should › should modify the file content with the name and description

    ENOENT: no such file or directory, open '/home/runner/work/teraslice/teraslice/packages/teraslice-cli/test/fixtures/generate-new-asset/generated-asset/new_asset/package.json'

      43 |
      44 |     it('should modify the file content with the name and description', () => {
    > 45 |         assert.jsonFileContent(path.join(rootAssetPath, 'package.json'), {
         |                ^
      46 |             name: 'new_asset-bundle',
      47 |             description: 'this is a new asset',
      48 |             version: '0.1.0'

      at readFile (node_modules/yeoman-assert/index.js:32:19)
      at Function.Object.<anonymous>.assert.JSONFileContent.assert.jsonFileContent (node_modules/yeoman-assert/index.js:263:24)
      at Object.<anonymous> (packages/teraslice-cli/test/generators/new-asset-spec.ts:45:16)
@godber
Copy link
Member

godber commented Dec 13, 2023

@godber godber changed the title New asset generator test failures New asset generator unit test failures Dec 13, 2023
@godber
Copy link
Member

godber commented Dec 13, 2023

Since this is a unit test it should be possible to run just this test over and over again in a loop until we see it fail.

@busma13
Copy link
Contributor Author

busma13 commented Dec 19, 2023

It looks like the errors are related to the timing of directories being created and destroyed. Creating temp directories with random names may fix this.

@sotojn sotojn self-assigned this Dec 19, 2023
@busma13
Copy link
Contributor Author

busma13 commented Dec 19, 2023

● Test suite failed to run

    ENOENT: no such file or directory, uv_cwd

      at process.cwd (node_modules/graceful-fs/polyfills.js:10:19)
      at process.Object.<anonymous>.process.cwd (node_modules/graceful-fs/polyfills.js:10:19)
      at process.Object.<anonymous>.process.cwd (node_modules/graceful-fs/polyfills.js:10:19)
      at Object.<anonymous> (node_modules/@npmcli/arborist/lib/debug.js:21:11)
      at Object.<anonymous> (node_modules/@npmcli/arborist/lib/tree-check.js:1:35)
      at Object.<anonymous> (node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:11:19)
      at Object.<anonymous> (node_modules/@npmcli/arborist/lib/arborist/index.js:40:3)
      at Object.<anonymous> (node_modules/@npmcli/arborist/lib/index.js:1:38)
      at Object.<anonymous> (node_modules/yeoman-environment/lib/util/repository.js:6:18)
      at Object.<anonymous> (node_modules/yeoman-environment/lib/environment.js:28:26)
      at Object.<anonymous>.YeomanTest.createEnv (node_modules/yeoman-test/lib/index.js:254:10)
      at YeomanTest.Object.<anonymous>.YeomanTest.createTestEnv (node_modules/yeoman-test/lib/index.js:293:10)
      at RunContext.Object.<anonymous>.RunContext.build (node_modules/yeoman-test/lib/run-context.js:112:32)
      at RunContext.Object.<anonymous>.RunContext._run (node_modules/yeoman-test/lib/run-context.js:173:12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants