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

bug: Windows system test failing for kitchen sink tests #895

Open
frankpengau opened this issue Sep 26, 2024 · 0 comments · May be fixed by #897
Open

bug: Windows system test failing for kitchen sink tests #895

frankpengau opened this issue Sep 26, 2024 · 0 comments · May be fixed by #897

Comments

@frankpengau
Copy link

Example: https://github.com/google/gts/actions/runs/9905181959/job/27525670544?pr=891

Example Output
Run npm run system-test

> gts@5.3.1 presystem-test
> npm run compile


> gts@5.3.1 compile
> tsc


> gts@5.3.1 postcompile
> ncp template build/template


> gts@5.3.1 system-test
> c8 mocha build/test/kitchen.js



  🚰 kitchen sink
D:\a\gts\gts\build\test\kitchen.js staging area: C:\Users\RUNNER~1\AppData\Local\Temp\tmp-4092-xKswcG63SiYD
npm notice
npm notice package: gts@5.3.1
npm notice Tarball Contents
npm notice 1.9kB .eslintrc.json
npm notice 111B .prettierrc.json
npm notice 20.9kB CHANGELOG.md
npm notice 11.5kB LICENSE
npm notice 4.7kB README.md
npm notice 2.2kB build/.eslintrc.json
npm notice 148B build/src/clean.d.ts
npm notice 1.8kB build/src/clean.js
npm notice 1.0kB build/src/clean.js.map
npm notice 1.3kB build/src/cli.d.ts
npm notice 4.8kB build/src/cli.js
npm notice 3.2kB build/src/cli.js.map
npm notice 600B build/src/index.d.ts
npm notice 763B build/src/index.js
npm notice 177B build/src/index.js.map
npm notice 537B build/src/init.d.ts
npm notice 9.6kB build/src/init.js
npm notice 8.0kB build/src/init.js.map
npm notice 2.3kB build/src/util.d.ts
npm notice 4.6kB build/src/util.js
npm notice 2.7kB build/src/util.js.map
npm notice 734B build/template/index.ts
npm notice 2.3kB package.json
npm notice 461B tsconfig-google.json
npm notice 288B tsconfig.json
npm notice Tarball Details
npm notice name: gts
npm notice version: 5.3.1
npm notice filename: gts-5.3.1.tgz
npm notice package size: 25.1 kB
npm notice unpacked size: 86.7 kB
npm notice shasum: d7e60b545629c9a021456b199aca786cec8a0813
npm notice integrity: sha512-6siIlAylbHbVP[...]ENFjl2fB0D5tw==
npm notice total files: 25
npm notice
moving packed tar to  C:\Users\RUNNER~1\AppData\Local\Temp\tmp-4092-xKswcG63SiYD\gts.tgz
out:  version: 20
Writing package.json...
{
  scripts: {
    lint: 'gts lint',
    clean: 'gts clean',
    compile: 'tsc',
    fix: 'gts fix',
    prepare: 'npm.cmd run compile',
    pretest: 'npm.cmd run compile',
    posttest: 'npm.cmd run lint'
  },
  devDependencies: {
    typescript: '^5.4.3',
    gts: 'file:../gts.tgz',
    '@types/node': '20.12.7'
  }
}
Writing ./tsconfig.json...
Writing ./.eslintrc.json...
Writing ./.eslintignore...
Writing ./.prettierrc.js...
Writing ./.editorconfig...
{
  "extends": "./node_modules/gts/tsconfig-google.json",
  "compilerOptions": {
    "rootDir": ".",
    "outDir": "build"
  },
  "include": [
    "src/**/*.ts",
    "test/**/*.ts"
  ]
}

{
  "extends": "./node_modules/gts/"
}

build/

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true

module.exports = {
  ...require('gts/.prettierrc.json')
}

Target src directory already has ts files. Template files not installed.

error:  npm warn exec The following package was not found and will be installed: file:C:\Users\RUNNER~1\AppData\Local\Temp\tmp-4092-xKswcG63SiYD\gts.tgz
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead

ensured config files existed
read dirContents length = 7
    ✔ it should run init (60659ms)
    1) should use as a non-locally installed module
    ✔ should terminate generated files with newline
    2) should lint before fix
'gts' is not recognized as an internal or external command,
operable program or batch file.
    3) should fix
'gts' is not recognized as an internal or external command,
operable program or batch file.
    4) should lint after fix
    5) should build
'gts' is not recognized as an internal or external command,
operable program or batch file.
    6) should clean


  2 passing (1m)
  6 failing

  1) 🚰 kitchen sink
       should use as a non-locally installed module:
     Error: ENOENT: no such file or directory, open 'C:\Users\RUNNER~1\AppData\Local\Temp\tmp-4092-5TTdZhXpCtVp\kitchen\tsconfig.json'
      at Object.readFileSync (node:fs:448:20)
      at Context.<anonymous> (test\kitchen.ts:92:29)
      at process.processImmediate (node:internal/timers:478:21)

  2) 🚰 kitchen sink
       should lint before fix:

      AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert.ok(res.stdout.includes('assigned a value but'))

      + expected - actual

      -false
      +true
      
      at Context.<anonymous> (test\kitchen.ts:147:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

  3) 🚰 kitchen sink
       should fix:
     Error: Command failed: npm run fix
'gts' is not recognized as an internal or external command,
operable program or batch file.

      at genericNodeError (node:internal/errors:984:15)
      at wrappedFn (node:internal/errors:538:14)
      at checkExecSyncError (node:child_process:890:11)
      at Object.execSync (node:child_process:962:15)
      at Context.<anonymous> (test\kitchen.ts:155:8)
      at process.processImmediate (node:internal/timers:478:21)

  4) 🚰 kitchen sink
       should lint after fix:
     Error: Command failed: npm run lint
'gts' is not recognized as an internal or external command,
operable program or batch file.

      at genericNodeError (node:internal/errors:984:15)
      at wrappedFn (node:internal/errors:538:14)
      at checkExecSyncError (node:child_process:890:11)
      at Object.execSync (node:child_process:962:15)
      at Context.<anonymous> (test\kitchen.ts:163:8)
      at process.processImmediate (node:internal/timers:478:21)

  5) 🚰 kitchen sink
       should build:
     Error: Command failed: npm run compile
      at genericNodeError (node:internal/errors:984:15)
      at wrappedFn (node:internal/errors:538:14)
      at checkExecSyncError (node:child_process:890:11)
      at Object.execSync (node:child_process:962:15)
      at Context.<anonymous> (test\kitchen.ts:167:8)
      at process.processImmediate (node:internal/timers:478:21)

  6) 🚰 kitchen sink
       should clean:
     Error: Command failed: npm run clean
'gts' is not recognized as an internal or external command,
operable program or batch file.

      at genericNodeError (node:internal/errors:984:15)
      at wrappedFn (node:internal/errors:538:14)
      at checkExecSyncError (node:child_process:890:11)
      at Object.execSync (node:child_process:962:15)
      at Context.<anonymous> (test\kitchen.ts:175:8)
      at process.processImmediate (node:internal/timers:478:21)



------------|---------|----------|---------|---------|-------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------|---------|----------|---------|---------|-------------------
All files   |   98.87 |    91.66 |     100 |   98.87 |                   
 kitchen.ts |   98.87 |    91.66 |     100 |   98.87 | 106-107           
------------|---------|----------|---------|---------|-------------------
Error: Process completed with exit code 1.

Speculating that it could be something wrong here: https://github.com/google/gts/blob/main/test/kitchen.ts#L76-L77

Not too sure, might be something to do with the use of tmp or spawn or execa?

Need some assistance looking into this.

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

Successfully merging a pull request may close this issue.

2 participants