amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

gulp test --files does not work for test/functional/test-cid

Open RJSumi opened this issue 8 years ago • 6 comments

What's the issue?

Using the --files flag for test/functional/test-cid produces spurious unit test breakages. .only works, but gives a much slower startup time.

How do we reproduce the issue?

gulp test --files=test/functional/test-cid.js --watch

What browsers are affected?

N/A

Which AMP version is affected?

This is a testing issue; no specific version of AMP is affected.

RJSumi avatar Apr 11 '18 20:04 RJSumi

/cc @jridgewell

RJSumi avatar Apr 11 '18 20:04 RJSumi

I don't experience this locally. Also you can use --nobuild for unit tests for a much faster run.

dreamofabear avatar Apr 11 '18 20:04 dreamofabear

/to @rsimha

jridgewell avatar Apr 12 '18 20:04 jridgewell

Some notes:

  • Unit tests don't need a full gulp build (takes 2-3 minutes), they only need gulp css (takes ~1 s).
  • You can tell gulp test that you're only running unit tests by passing in --unit.
  • You can avoid the annoying popup browser window by passing in --headless.
  • You can avoid building by using --nobuild (you wouldn't use this with --watch).

(I believe all this is stuff documented at the top when you run gulp test, and in the developer docs. Let me know if you have ideas for how to make the instructions more useful.)

@RJSumi The following command works for me. Can you try it and let me know what you see?

gulp test --headless --watch --unit --files test/functional/test-cid.js

rsimha avatar Apr 12 '18 20:04 rsimha

Also, can you post a gist of the spurious unit test breakages? How slow is the startup time, and where does it look like it's waiting? Are you fully synced to HEAD? (There have been a bunch of test infra changes over the past couple days.)

rsimha avatar Apr 12 '18 20:04 rsimha

Closing this. Please reopen if issues persist after you try what's in https://github.com/ampproject/amphtml/issues/14562#issuecomment-380930563

rsimha avatar Jun 04 '18 15:06 rsimha