CSC495-2014 / TeamworkEnglewoodGit

GNU General Public License v2.0
5 stars 15 forks source link

Testing #143

Closed cdwainscott closed 10 years ago

cdwainscott commented 10 years ago

so i finally got my git issues smoothed out and got phpunit installed on my computer. I ran my routes tests and all of the tests failed because of mkdir() returning "file exists." I am going to take a guess and say this is due to me running the project on a windows machine.

@kjmcmahon do you think i can get with you tomorrow sometime or monday at 12 to try and run them on your linux machine? I do not think i will have time to install linux and get everything set up tomorrow and have work all day sunday.

If anyone else can help let me know.

David

cdwainscott commented 10 years ago

ok a lil more info

i narrowed it down to the ssh key gen

FileSystem.php line 296: mkdir($userPath, Config::get('filesystem.permissions.directory'), true); // RW for user

cdwainscott commented 10 years ago

ok getting farther... guess i have to generate the key only once so it was erroring everytime it tried to make a new one (ken i think u had this issue too)

on copyPost and movePost an error is thrown for a file/directory not found

mkDirPost and index post both fail due to bad responses

all the git routes error because they cant find the ssh key (i think, probably window/linux issue)

the customcmd route errors because customCmd method does not exist

project page route error unless i hard code in the user (might mean that my tests arent passing the user and project correctly, not really sure)

Any ideas? is this all linux file system issues?

samuelfrench commented 10 years ago

@cdwainscott The customCmd function should be called cmd in the route to reflect the name change in the controller. That is coming along with my next pull request (should have time tomorrow, it's been ready to go I just need to test). If you want you can merge my testing branch to try it (https://github.com/samuelfrench/TeamworkEnglewoodGit/tree/testing).

ZAM- commented 10 years ago

All I want to say is make sure you have the directories in place first before you test. That would be equivalent to simulating the git clone action.

mikeholler commented 10 years ago

on copyPost and movePost an error is thrown for a file/directory not found

Just as a reminder, I'd also like to note that just because a method throws an exception doesn't mean it should be fixed. There are many cases we want to throw exceptions from functions. With this example, it's possible that this is desired behavior. I cannot tell you for certain, because there is not enough information in your error description.

One thing to keep in mind when you're reporting errors is they should contain the following information:

Without a detailed report containing this information, it could be very hard to track down the problem. Additionally, If you've found something that you know is a problem, please include this information in a new GitHub issue for people to see. Do not assign anyone to the issue, as I will look at it and assign and prioritize the issue to whomever it makes sense to assign it to.

kjmcmahon commented 10 years ago

I'll be In the lab pretty much all today (Saturday) as well as Sunday. I'm not positive but I think you only need to create the key once and not before each of your test functions. If you're using setUp() that code is executed before every test fuction.

cdwainscott commented 10 years ago

Sorry misread my schedule. I worked all day Saturday so I will be in the lab tomorrow (Sunday) instead. See what I can figure out then.

cdwainscott commented 10 years ago

so i think i may have found something that should be a quick fix if it isnt already. On line 38 of the GitCommands.php it looks like the set private key has '/id_rsa' and everywhere else it is '/ida_rsa'

even after this fix i cannot get the git commands to find the path to the private key. I have added the directories and double checked where the files are but still no luck. Once this issue is straightened out it shouldnt take too long to finish this part up

not sure if this is an issue but the sshkeygen created my key in my c: drive and the application was looking for it in the laravel folder (where i was running my tests from). Will this be fixed when it is deployed or is this something in the code that needs to be fixed (see gitcommand.php line 38 vs filesystem.php line 294). i moved the directories around in my computer to see if it would fix it but it didnt.

also if the user already has a sshkey will our program error because the file already exists if they try and make a new one? is there a way for his to happen? how will this be handled?

other than that all or my tests work except mkdirPost fails because it returns a bad response. I am not fully understanding that that does exactly so if anyone had ideas on that let me know.

mikeholler commented 10 years ago

@cdwainscott, please see my comments here about how we should be reporting problems with code discovered through testing.

cdwainscott commented 10 years ago

ok so do you want me to create a new issue then? all of this can be replicated with my route testing files. dont really know how much more detailed i can get other than i am testing with phpunit and relaying my results

samuelfrench commented 10 years ago

@cdwainscott Make sure you have the key named id_rsa and have it directly in your user folder /data/users/cdwainscott not in a subdirectory.