From noreply at rubyforge.org Wed Dec 3 08:29:03 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Wed, 3 Dec 2008 08:29:03 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081203132904.CFDF51858191@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 08:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 07:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 07:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 06:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Fri Dec 5 09:10:41 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 5 Dec 2008 09:10:41 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081205141042.1227C18581B0@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 07:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2008-12-05 07:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 06:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 05:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 04:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Fri Dec 5 10:30:57 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 5 Dec 2008 10:30:57 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081205153057.59C3C1858190@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 08:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 08:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 07:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 07:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 06:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Fri Dec 5 10:40:57 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 5 Dec 2008 10:40:57 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081205154057.7AA7C18581B8@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Kouhei Sutou (kou) Date: 2008-12-06 00:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 23:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 22:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 22:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 21:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 21:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 20:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Fri Dec 5 10:44:33 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 5 Dec 2008 10:44:33 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081205154433.B7A2F1588057@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 08:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-05 09:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 08:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 07:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 07:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 06:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Fri Dec 5 10:45:41 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 5 Dec 2008 10:45:41 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081205154541.E5CC918581B8@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 08:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:45 Message: If it is not default, it should not create and write data to these directories. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-05 09:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 09:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 08:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 07:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 07:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 06:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Sat Dec 6 06:20:07 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 6 Dec 2008 06:20:07 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081206112007.A24971858182@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Open Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Kouhei Sutou (kou) Date: 2008-12-06 20:20 Message: Ah. I understood. It's a bug. I wanted to disable test result saving in non-priority mode. I'll fix it later. (I'm busy this weekend.) ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:45 Message: If it is not default, it should not create and write data to these directories. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 00:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 23:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 22:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 22:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 21:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 21:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 20:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Thu Dec 11 08:18:50 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 11 Dec 2008 08:18:50 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081211131850.9974C16780DC@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None >Status: Closed Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Kouhei Sutou (kou) Date: 2008-12-11 22:18 Message: I've fixed it in trunk. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 20:20 Message: Ah. I understood. It's a bug. I wanted to disable test result saving in non-priority mode. I'll fix it later. (I'm busy this weekend.) ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:45 Message: If it is not default, it should not create and write data to these directories. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 00:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 23:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 22:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 22:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 21:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 21:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 20:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Mon Dec 15 17:26:56 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 15 Dec 2008 17:26:56 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081215222656.D027E158805E@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 07:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Closed Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2008-12-15 15:26 Message: Excellent. Any word on a 2.02 release date? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-11 06:18 Message: I've fixed it in trunk. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 04:20 Message: Ah. I understood. It's a bug. I wanted to disable test result saving in non-priority mode. I'll fix it later. (I'm busy this weekend.) ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 08:45 Message: If it is not default, it should not create and write data to these directories. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 08:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-05 08:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-05 08:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 07:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 06:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 06:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 05:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 05:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 04:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 From noreply at rubyforge.org Mon Dec 15 18:16:42 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 15 Dec 2008 18:16:42 -0500 (EST) Subject: [test-unit-tracker] [ test-unit-Feature Requests-22988 ] Provide a .test-result cleanup hook Message-ID: <20081215231642.6BA041588057@rubyforge.org> Feature Requests item #22988, was opened at 2008-11-25 23:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650 Category: None Group: None Status: Closed Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Provide a .test-result cleanup hook Initial Comment: Hi, Can you please provide a hook for cleaning up (deleting) the .test-result directory when all tests are finished? I think something users could put directly in the shutdown method would be ideal. My apologies if something like this already exists, but I didn't see it. Regards, Dan ---------------------------------------------------------------------- >Comment By: Kouhei Sutou (kou) Date: 2008-12-16 08:16 Message: OK. I'll release 2.0.2 in this weekend. Do you have any other requests? If you have, please submit new request. # I want to add data-driven test support but I may not make it in time... ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-16 07:26 Message: Excellent. Any word on a 2.02 release date? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-11 22:18 Message: I've fixed it in trunk. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 20:20 Message: Ah. I understood. It's a bug. I wanted to disable test result saving in non-priority mode. I'll fix it later. (I'm busy this weekend.) ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:45 Message: If it is not default, it should not create and write data to these directories. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:44 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-12-06 00:40 Message: ? --priority-mode isn't default. ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-06 00:30 Message: I think storing things about test runs in a file should be optional. By default, I think each run should be totally independent. If a user wants to cache data about previous runs in order to skip the ones that have already worked, fine with me, but this seems an exceptionally dangerous default. By default, each run should run all tests (at least, those specified, say, with the --name or --testcase option). I'd strongly suggest the safest, most conservative route when writing a unit test framework, and here I think that means run all tests each time without any caching, and allow the user to specify a cache directory if they want to. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-12-05 23:10 Message: Hi, Actually, I'm not sure how test results could be stored in memory between test runs if each new run is a new process unless I'm the one who's missing something. However, I'd definitely favor moving .test-results files to the user's temp directory. Using Dir.tmpdir should do the trick. I'll submit a patch later. Regards, Dan ---------------------------------------------------------------------- Comment By: Bill Lear (rael007) Date: 2008-12-03 22:29 Message: I couldn't agree with Daniel more. Polluting a user's working tree with .test-result directories is very nasty. If the file system ABSOLUTELY must be used (and I think it should not, see below), there at least should be options to 1) automatically remove this directory after the tests have run (and NOT force the user to write new code or explicitly use a hook each time to do this); 2) put the directory in some other root (e.g., /tmp). Using the file system to store state for test runs seems a bit crazy to me. You say you need it for 'the next test run' to ensure tests that have passed are not run again. Do you mean that when the user re-runs the tests, those that have passed will not run again? This does not seem to be true (I have just tested this, and it appears when I run the tests again, it runs all of them, even if they have already passed). In fact, I have just modified priority.rb to use a hash for storing test results in-memory. It seems to work just fine. Is there something I am missing here? Here is the hack I just tested: 4,5d3 < $fake_directory = {} < 72,75c70 < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end < #FileUtils.rm_f(passed_file) --- > FileUtils.rm_f(passed_file) 80,81c75 < $fake_directory[passed_file] = true < #FileUtils.touch(passed_file) --- > FileUtils.touch(passed_file) 83,86c77 < #FileUtils.rm_f(passed_file) < if $fake_directory.has_key?(passed_file) < $fake_directory.delete(passed_file) < end --- > FileUtils.rm_f(passed_file) 96,97c87 < #File.exist?(passed_file) < return $fake_directory.has_key?(passed_file) --- > File.exist?(passed_file) 111,112c101 < $fake_directory[dir] = true < #FileUtils.mkdir_p(dir) --- > FileUtils.mkdir_p(dir) I'm sure a more elegant method could be used, but it seems that there is no need to use the file system, unless I am mistaken. ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 22:05 Message: Hi, I use Eclipse as my IDE, mainly for project management, so when the .test-result files are generated, it causes my project to get out of sync with my remote source control manager. If I can store them somewhere else, I wouldn't have to remember to manually delete them before committing, tagging, etc. It's not a major issue, though. I just thought it would be nice to have a hook to go clean them up automatically. I suppose I could just custom code as part of a 'rake clean' task. I think making priority mode implicit would be a mistake. I sometimes refactor tests after I've written them. If I update a test, it wouldn't get re-run unless I force it. Regards, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 21:32 Message: There is no option for that. Should I add an option for that? What is the problem for now? ".test-result" directory name? IMHO, I want to work the priority mode feature intelligently (maybe implicitly) ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-11-26 21:17 Message: I understand. I was asking for something that would be optional. Hm, can an alternative directory location be specified? Thanks, Dan ---------------------------------------------------------------------- Comment By: Kouhei Sutou (kou) Date: 2008-11-26 20:43 Message: Uhm... We can't delete the .test-result directory because the directory is used in the next test run. If we delete the .test-result, all tests will be ran because they are treated as not passed tests. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=21859&aid=22988&group_id=5650