BrianClement / Demo2

Test repository for syncing with local VS repository
0 stars 0 forks source link

how to run the complete test suite?_U #56

Open BrianClement opened 7 years ago

BrianClement commented 7 years ago

[Issue originally created 2017-Mar-22 01:19:52 UTC by rgommers]

The first part of npm test runs fine, 9/9 tests pass. It pops up Chrome and then stops where it says it needs a Google API token. It's not clear where to get the token or where to paste that in - neither the browser nor the command line seem to have a place for it. How is this supposed to be done?

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-23 04:35:19 UTC by racleave]

Have modified tests to use a global variable that has the current token, and the web app so the token can be viewed. See docs.

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-24 00:34:22 UTC by rgommers]

Hmm, trying that but doesn't seem to work. Before, 9/9 unit tests succeeded and then Karma got stuck on the login. Now it still gets stuck on login, but seems even less happy:

24 03 2017 13:21:00.212:WARN [karma]: Port 9876 in use
24 03 2017 13:21:00.217:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9877/
24 03 2017 13:21:00.218:INFO [launcher]: Launching browser Chrome with unlimited concurrency
24 03 2017 13:21:00.325:INFO [launcher]: Starting browser Chrome
24 03 2017 13:21:12.265:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket bS7zWyLWYkXU9aYTAAAA with id 93225000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 0 of 9 SUCCESS (0 secs / 0 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 0 of 9 DISCONNECTED (20.237 secs / 0 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
LOG: 'Original timeout', 5000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 DISCONNECTED (20.237 secs / 1.174 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 DISCONNECTED (20.237 secs / 1.174 secs)
LOG: 'Original timeout', 20000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 DISCONNECTED (20.237 secs / 1.361 secs)
LOG: 'About to try to log in'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 DISCONNECTED (20.237 secs / 1.361 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 DISCONNECTED (20.237 secs / 1.361 secs)
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 DISCONNECTED (22.918 secs / 1.64 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnectedundefined
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 DISCONNECTED (22.918 secs / 1.64 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
24 03 2017 13:23:53.950:ERROR [launcher]: Chrome crashed.

24 03 2017 13:23:53.986:INFO [launcher]: Trying to start Chrome again (1/2).
24 03 2017 13:23:56.118:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket 7lFGfPqglRT1uxqSAAAB with id 93225000
LOG: 'Original timeout', 5000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 SUCCESS (0 secs / 0.917 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 SUCCESS (0 secs / 0.917 secs)
LOG: 'Original timeout', 20000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.056 secs)
LOG: 'About to try to log in'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.056 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.056 secs)
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 SUCCESS (1.261 secs / 1.249 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnectedundefined
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 SUCCESS (1.261 secs / 1.249 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnectedundefined
24 03 2017 13:24:02.425:ERROR [launcher]: Chrome crashed.

24 03 2017 13:24:02.452:INFO [launcher]: Trying to start Chrome again (2/2).
24 03 2017 13:24:04.557:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket VdTxMS9YP7SsmP-cAAAC with id 93225000
LOG: 'Original timeout', 5000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 SUCCESS (0 secs / 0.93 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 6 of 9 SUCCESS (0 secs / 0.93 secs)
LOG: 'Original timeout', 20000
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.073 secs)
LOG: 'About to try to log in'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.073 secs)
LOG: 'After async'
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 1.073 secs)
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 SUCCESS (1.281 secs / 1.268 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnectedundefined
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 9 of 9 SUCCESS (1.281 secs / 1.268 secs)
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
  Disconnectedundefined
24 03 2017 13:24:11.885:ERROR [launcher]: Chrome crashed.

24 03 2017 13:24:11.910:ERROR [launcher]: Chrome failed 2 times (crashed). Giving up.

[7]+  Stopped                 npm test

The "Chrome crashed" is from me closing the browser window after a while.

Any idea how I get this to work?

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-26 19:09:24 UTC by racleave]

It looks like the normal port for the karma server (9877) is being used, and so karma is serving on localhost:9878. The javascript origins have to be in the API credentials for google auth, and only localhost:9877 was in there. I've added port 9878 so you could try again...? (You'll need to get and paste in a new token). I'll update the docs to make it clearer about these credentials.

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-27 00:27:01 UTC by rgommers]

Updated token:

$ git diff
diff --git a/discview/src/test_token.js b/discview/src/test_token.js
index 70542be..9470ed9 100644
--- a/discview/src/test_token.js
+++ b/discview/src/test_token.js
@@ -1,2 +1,2 @@
-var test_token = "eyJhbGciOiJ...

In karma.conf.js it says: port: 9876.

Test says:

27 03 2017 13:16:12.009:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/

So that looks fine. Chrome still hangs though.

I'm working on Windows right now, maybe that's problematic?

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-27 20:51:15 UTC by racleave]

I've allowed http://0.0.0.0:9876 (as well as localhost). Can you try again?

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-27 21:27:00 UTC by rgommers]

No change, still ends with "log in with your Google account". There's zero indication of what's wrong. I'm logged into Chrome with my gmail account, and check that test_token.js is just changed and saved.

BrianClement commented 7 years ago

[Comment originally created 2017-Mar-31 03:00:01 UTC by racleave]

I'll get back to this soon Ralf. I think I have to reassess how these tests work (i.e. I should probably separate the webapp tests from the API tests. So I will wait until that is done to see if this issue gets resolved in the process. Ra