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

Testing Framework + misc changes #160

Merged
merged 60 commits into from
Sep 2, 2020
Merged

Conversation

RobinReborn
Copy link
Contributor

@RobinReborn RobinReborn commented Aug 25, 2020

I have a basic testing framework that tests the top level webgazer functions and basic regression.

There's a script to automatically run the tests called by npm run test - it won't work on Windows.

I've made a few minor changes outside the scope of testing, there were a few things I noticed while creating the tests that I considered changing (like the structure of index.mjs - right now it has global variables and I think it would be better off if they were all class variables) but I didn't want to change too much until we had agreed on a method of testing so that any incorrect changes made could be detected by tests.

Also for my fix of issue #159 I need the webgazer website ( https://webgazer.cs.brown.edu/data/ ) to include the current readme.md

RobinReborn and others added 30 commits July 15, 2020 15:59
Add and remove files for PR

Replace more files with upstream/master version, update readme, set symlink webgazer.js for webgazerExtractor to use

Fix webgazers, edit collision.html to separate js from html
Update commit hash request in readme
Forgot to update the website instructions too.
* Fix webgazer website + commit hook

Readd dist directory
@RobinReborn
Copy link
Contributor Author

@Skylion007 Can I get a review on this?

@@ -422,6 +418,7 @@
"sprintf-js": "~1.0.2"
}
},
>>>>>>> d3a281f... Refactor and clean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file has a number of merge conflict tags in it. could you clean it up a bit? thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done - interestingly enough it passes the tests with those conflicts.

@jeffhuang
Copy link
Contributor

Hi Robin. We're definitely looking into this. We're a bit slower right now since this is a large changelog so there's lots to review, but will be getting to it. Thanks again for your contribution.

@Skylion007
Copy link
Collaborator

Sorry for the delay in getting back, been busy with ECCV.

The script doesn't work on OSX, which seems avoidable. It complains about netstat: option requires an argument -- p so I suspect it's a difference with the old gnu utils on OSX. Let's see if we can resolve it so people can run tests on OSX. As a result, all tests fail on OSX.

@RobinReborn
Copy link
Contributor Author

OK - I changed the netstat to lsof which should work. I also modified the sed command based on this:

https://stackoverflow.com/questions/2320564/sed-i-command-for-in-place-editing-to-work-with-both-gnu-sed-and-bsd-osx

Unfortunately I don't have the ability to test on OSX myself.

@Skylion007
Copy link
Collaborator

So it almost works, one other issue is that npm run tests for the main package relies on browser-sync which isn't installed. You should add it to the devDependencies.

@@ -0,0 +1,24 @@
#!/bin/sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the proper node utilities, it should be possible to get this part to work even on Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done some testing in windows and attempted to rewrite the testing script as a .bat but I cannot verify it works because #162 - I couldn't get webgazerExtracClient.py to work with windows.

@Skylion007
Copy link
Collaborator

What chained in the latest force push?

@RobinReborn
Copy link
Contributor Author

RobinReborn commented Aug 31, 2020

It should just be the devDependencies package.json (and package-lock and the dist files), currently working on getting the .sh file to run cross platform.

EDIT - it was actually just a linefeed change

@Skylion007
Copy link
Collaborator

@RobinReborn Apparently, this is a known issue on Windows with a fix in this thread:

if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

per tornadoweb/tornado#2751

@RobinReborn
Copy link
Contributor Author

RobinReborn commented Sep 1, 2020

I did more work on windows compatibility but discovered that there's also an issue with the symlinks we are using - and there was also a husky/npm issue that prevented me from commiting.

Given the obstacles I am not sure if it is worth making this compatible with Windows. I did investigate https://www.npmjs.com/package/shelljs but that doesn't support all of the commands I'd like to use.

EDIT: additionally there are issues with fsevents (a dependency in package-lock.json) and Windows)

@Skylion007
Copy link
Collaborator

Skylion007 commented Sep 1, 2020 via email

@RobinReborn
Copy link
Contributor Author

So do you want to make an issue for Windows compatibility?

As it is a windows user should be able to run the tests by manually running both servers (and copying dist/webgazer.js to www/data/src/ )

I'm not sure what I should do to finish this PR - I could revert my last few commits and bring it to a state where it works on Linux and MacOS. But the Windows issues have been difficult and it seems like it would probably be easier just to dockerize this project (but that should be another PR).

@Skylion007
Copy link
Collaborator

Skylion007 commented Sep 2, 2020 via email

@Skylion007 Skylion007 merged commit 3b52e4e into brownhci:master Sep 2, 2020
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 this pull request may close these issues.

4 participants