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

Failing test #2

Closed
adam-lynch opened this issue Jun 20, 2014 · 24 comments · Fixed by #135
Closed

Failing test #2

adam-lynch opened this issue Jun 20, 2014 · 24 comments · Fixed by #135

Comments

@adam-lynch
Copy link
Collaborator

The test fails for me.

  • Windows 8.1
  • Node 0.10.20
  • npm 1.3.11
  • node-webkit 0.9.2-1 (global install)

Dump:

C:\Users\Digital\Code\GitHub\updater\test

�[0m�[0m
�[0m  build app: copy current to temp�[0m
�[0m    change manifest, build from temp�[0m
�[4mRunning "nodewebkit:src" (nodewebkit) task�[24m

C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\cache\win\0.9.2\nw.exe

�[32m>> �[39mCreated a new release with node-webkit (0.9.2) for win

�[32m>> �[39m@ C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp



�[4mRunning "copy:win" (copy) task�[24m
Copied �[36m1�[39m files


�[32mDone, without errors.�[39m

�[0m      package for [current os]�[0m
compress:win
�[4mRunning "compress:win" (compress) task�[24m

Created �[36m./test/deploy0.2/releases/updapp/win/updapp.zip�[39m (26759413 bytes)



�[32mDone, without errors.�[39m

�[0m        change manifest, build from temp�[0m
�[4mRunning "nodewebkit:src" (nodewebkit) task�[24m

C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\cache\win\0.9.2\nw.exe

�[32m>> �[39mCreated a new release with node-webkit (0.9.2) for win

�[32m>> �[39m@ C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp



�[4mRunning "copy:win" (copy) task�[24m

Copied �[36m1�[39m files




�[32mDone, without errors.�[39m

�[0m          run built app for [os], wait for app to be updated�[0m

          �[31m  1) "before all" hook�[0m

�[92m �[0m�[32m 0 passing�[0m�[90m (4s)�[0m

@edjafarov
Copy link
Collaborator

@adam-lynch could you run the app directly
C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe
does the app starts?
It would be great to see screencast:) you can use http://www.techsmith.com/jing.html

@adam-lynch
Copy link
Collaborator Author

Oh, and after running grunt --version, I get:

grunt-cli v0.1.11
grunt v0.4.5

@adam-lynch
Copy link
Collaborator Author

@edjafarov I didn't see your reply... I'll test it after lunch :)

@adam-lynch
Copy link
Collaborator Author

@edjafarov I got "Error: Cannot find module 'request'" so I npm installed inside of /app``. Then it complained thattar.gzis missing so I added it to/app/package.json` and installed it. Now the tests give me:

1 failing

  1) build app: copy current to temp change manifest, build from temp package for [current os] change manifest, build from temp "before all" hook:

      Uncaught AssertionError: expected 3 to equal 0
      + expected - actual

      +0
      -3

      at ChildProcess.<anonymous> (C:\Users\Digital\Code\GitHub\updater\test\basicTest.spec.js:81:29)
      at ChildProcess.EventEmitter.emit (events.js:98:17)
      at maybeClose (child_process.js:735:16)
      at Process.ChildProcess._handle.onexit (child_process.js:802:5)

Weirdly though, if I run C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe now, it still complains about tar.gz not being there.


I checked my task manager and found two versions of updapp still running so I killed it, re-ran the tests and got:

> node-webkit-updater@0.0.2 test C:\Users\Digital\Code\GitHub\updater
> node node_modules/grunt-cli/bin/grunt clean mochaTest

Running "clean:main" (clean) task
Cleaning test/app...OK

Running "mochaTest:test" (mochaTest) task
C:\Users\Digital\Code\GitHub\updater\test


  build app: copy current to temp
    change manifest, build from temp
Running "nodewebkit:src" (nodewebkit) task

C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\cache\win\0.9.2\nw.exe

>> Created a new release with node-webkit (0.9.2) for win

>> @ C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp



Running "copy:win" (copy) task

Copied 1 files

Done, without errors.

      package for [current os]
compress:win
Running "compress:win" (compress) task

Created ./test/deploy0.2/releases/updapp/win/updapp.zip (27557146 bytes)



Done, without errors.

        change manifest, build from temp
Running "nodewebkit:src" (nodewebkit) task

C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\cache\win\0.9.2\nw.exe

>> Created a new release with node-webkit (0.9.2) for win

>> @ C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp



Running "copy:win" (copy) task

Copied 1 files

Done, without errors.

          run built app for [os], wait for app to be updated
            1) "before all" hook

  0 passing (5s)
  1 failing

  1) build app: copy current to temp change manifest, build from temp package for [current os] change manifest, build from temp run built app for [os], wait for app to be updated "before all" hook:
     Uncaught Error: listen EADDRINUSE
      at errnoException (net.js:901:11)
      at Server._listen2 (net.js:1039:14)
      at listen (net.js:1061:10)
      at Server.listen (net.js:1127:5)
      at Function.app.listen (C:\Users\Digital\Code\GitHub\updater\node_modules\express\lib\application.js:548:24)
      at Context.<anonymous> (C:\Users\Digital\Code\GitHub\updater\test\basicTest.spec.js:94:17)
      at Hook.Runnable.run (C:\Users\Digital\Code\GitHub\updater\node_modules\grunt-mocha-test\node_modules\mocha\lib\runnable.js:196:15)
      at next (C:\Users\Digital\Code\GitHub\updater\node_modules\grunt-mocha-test\node_modules\mocha\lib\runner.js:259:10)
      at Object._onImmediate (C:\Users\Digital\Code\GitHub\updater\node_modules\grunt-mocha-test\node_modules\mocha\lib\runner.js:276:5)
      at processImmediate [as _immediateCallback] (timers.js:330:15)

@edjafarov
Copy link
Collaborator

Uncaught Error: listen EADDRINUSE
it looks like something on your machine is using 3000 port https://github.com/edjafarov/updater/blob/master/test/basicTest.spec.js#L94 check your task manager it might be something is still there
you can try to change the port in the test

@adam-lynch
Copy link
Collaborator Author

Ok there was something on 3000 (not even sure what it was but anyway). After changing the port and running the test, an app opened with an error (I forgot to actually save what it said). I then re-ran the tests but it complained that it can't clean an empty directory. I just manually removed test/app and re-ran the tests. The mocha reporter said they passed but the nw app that opened shows current version 0.0.1, is that correct? I'm assuming the updated app would be greater than 0.0.1.

@edjafarov
Copy link
Collaborator

you can run tests with npm test - it should clean test/app https://github.com/edjafarov/updater/blob/master/package.json#L8

in the app's toolbar you can open chrome dev tools, and check console. It should say why is it failing.
damn! why it was working for me 😳
http://screencast.com/t/MSTKqVS3 - it should work like that

@adam-lynch
Copy link
Collaborator Author

@edjafarov I am. The grunt clean task mustn't like non-empty directories on Windows. Is there a force option? I don't know, I'd normally use Gulp over Grunt.

The error in the console:
image

@edjafarov
Copy link
Collaborator

https://github.com/edjafarov/updater/blob/master/test/basicTest.spec.js#L25 if you changed the port, you need to change it in config also:)
I need to move the port somewhere. Or at least in env.

@adam-lynch
Copy link
Collaborator Author

@edjafarov I did. The only place 3000 exists now is in the readme and in some dependencies' files.

@adam-lynch
Copy link
Collaborator Author

Huh. It worked. So, changing it to 3001 helped as I said, but now it wouldn't work until I changed it to 3002. I wonder is it releasing the port. I still get the error(s) listed above even when it works.

@edjafarov
Copy link
Collaborator

try http://localhost:3000/releases/updapp/win/updapp.zip inside your browser (check if the server is serving the file)
strange that the test is not destroying the server - when the test fails the server should die.
http://ss64.com/nt/tasklist.html tasklist should show you all the processes in win

@adam-lynch
Copy link
Collaborator Author

http://localhost:3000/releases/updapp/win/updapp.zip returned "Cannot GET /releases/updapp/win/updapp.zip". 3001 and 3002 returned a 404.

@edjafarov
Copy link
Collaborator

strange why it returns ECONREFUSED then. It does that https://github.com/edjafarov/updater/blob/master/app/updater.js#L34 after getting a response.

@edjafarov
Copy link
Collaborator

strange, I just fetched clean app to my win8.1 virtual machine, does npm install in root and app folders. npm test worked fine. node 0.10.18 npm 1.4.16

@adam-lynch
Copy link
Collaborator Author

I just reproduced it on another Windows 8 machine. Fresh clone (of my fork, but same really), etc.

I think we should get the test to fail if there's any console error and then obviously fix the problem.

@edjafarov
Copy link
Collaborator

Does #6 #7 fixed the problem?

@adam-lynch
Copy link
Collaborator Author

  1. My guess was that technically yes the tests no longer fail now, but I just tried on the first machine again. I got:

    > node-webkit-updater@0.0.2 test C:\Users\Digital\Code\GitHub\updater
    > node node_modules/grunt-cli/bin/grunt clean mochaTest
    
    Running "clean:main" (clean) task
    Cleaning test/app...OK
    
    Running "mochaTest:test" (mochaTest) task
      C:\Users\Digital\Code\GitHub\updater\test
    
    
      build app: copy current to temp
        change manifest, build from temp
    Running "nodewebkit:src" (nodewebkit) task
    
    C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\cache\win\0.9.2\nw.exe
    
    >> Created a new release with node-webkit (0.9.2) for win
    
    >> @ C:\Users\Digital\Code\GitHub\updater\test\deploy0.2\releases\updapp
    
    
    
    Running "copy:win" (copy) task
    
    Copied 1 files
    
    Done, without errors.
    
          package for [current os]
    compress:win
    Running "compress:win" (compress) task
    
    Created ./test/deploy0.2/releases/updapp/win/updapp.zip (27406906 bytes)
    
    
    
    Done, without errors.
    
        change manifest, build from temp
    Running "nodewebkit:src" (nodewebkit) task
    
    C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\updapp.nw win C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\cache\win\0.9.2\nw.exe
    
    >> Created a new release with node-webkit (0.9.2) for win
    
    >> @ C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp
    
    
    
    Running "copy:win" (copy) task
    
    Copied 1 files
    
    Done, without errors.
    
              run built app for [os], wait for app to be updated
    C:\Users\Digital\Code\GitHub\updater\test\deploy0.1\releases\updapp\win\updapp\updapp.exe
    { '0': { [Error: Command failed: ] killed: false, code: -1073740771, signal: null },
    '1': '',
    '2': '' }
      opened and updated
      original folder was changed
                  V should be updated (3693ms)
                  1) should be updated
    
    
        1 passing (10s)
        1 failing
    
        1) build app: copy current to temp change manifest, build from temp package for [current os] change manifest, build from temp run built app for [os], wait for app to be updated should be updated:
           Uncaught Error: watch EPERM
            at errnoException (fs.js:1019:11)
            at FSEvent.FSWatcher._handle.onchange (fs.js:1037:26)
    
    
    
    
        1 passing (10s)
        1 failing
    
        1) build app: copy current to temp change manifest, build from temp package for [current os] change manifest, build from temp run built app for [os], wait for app to be updated should be updated:
           Uncaught Error: watch EPERM
            at errnoException (fs.js:1019:11)
            at FSEvent.FSWatcher._handle.onchange (fs.js:1037:26)
    
    
    
      Warning: Task "mochaTest:test" failed. Use --force to continue.
    
      Aborted due to warnings.
      npm ERR! weird error 3
      npm ERR! not ok code 0
  2. Then I killed all updapp.exe and nw.exe (my own app) processes and it worked.

  3. Repeated step 2 and it failed again (with the same error(s) as step 1 I think).

  4. Repeated again, same results.

  5. Repeated again, it worked. 😦

@edjafarov
Copy link
Collaborator

Strange O_O. Is there a way you could reproduce this in Virtualbox win8?
I would be able to copy the box and pay around with this artifact.

@adam-lynch
Copy link
Collaborator Author

Sorry for not getting back to you. I've just re-cloned the project and I got the same error. All I'm doing is npm installing (at root and in app/) and running npm test. It's easy to reproduce.

@edjafarov
Copy link
Collaborator

yeah, I got the same error. Though it looks like error in tests rather than update itself. I will look into the problem.

@adam-lynch
Copy link
Collaborator Author

Agreed. Thanks.

adam-lynch added a commit that referenced this issue Aug 23, 2014
Bumped to 0.0.11.

It's probably just luck, but #2 isn't happening now for me.
@edjafarov
Copy link
Collaborator

@adam-lynch this should be closed right?

@adam-lynch
Copy link
Collaborator Author

@edjafarov As far as I know, the test still fails. I.e. the updating works but the test has a failure.

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

Successfully merging a pull request may close this issue.

2 participants