You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
(33) |
Jun
(44) |
Jul
(40) |
Aug
(23) |
Sep
(26) |
Oct
(41) |
Nov
(37) |
Dec
(42) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(40) |
Feb
(58) |
Mar
(81) |
Apr
(94) |
May
(77) |
Jun
(83) |
Jul
(55) |
Aug
(118) |
Sep
(51) |
Oct
(193) |
Nov
(77) |
Dec
(17) |
| 2005 |
Jan
(56) |
Feb
(87) |
Mar
(83) |
Apr
(155) |
May
(115) |
Jun
(157) |
Jul
(90) |
Aug
(87) |
Sep
(145) |
Oct
(56) |
Nov
(105) |
Dec
(88) |
| 2006 |
Jan
(56) |
Feb
(93) |
Mar
(30) |
Apr
(46) |
May
(46) |
Jun
(16) |
Jul
(33) |
Aug
(54) |
Sep
(47) |
Oct
(21) |
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
|
2
(2) |
3
(1) |
4
|
5
|
|
6
(1) |
7
|
8
(2) |
9
(2) |
10
|
11
(2) |
12
|
|
13
|
14
(8) |
15
(15) |
16
(7) |
17
(9) |
18
(3) |
19
|
|
20
|
21
(4) |
22
(10) |
23
(12) |
24
(5) |
25
(2) |
26
|
|
27
(5) |
28
(6) |
29
(6) |
30
(3) |
|
|
|
|
From: fehaar <fe...@go...> - 2005-11-30 23:33:39
|
Hi, I saw that people on the list were lookig for an answer to this = question. Well I found one... I ran into the same problem with 1.0 final and it really bugged me. I = was furious. Not only did RC1 delete all the files I had put in the = directory, causing me to lose some stuff that had to be recovered from backup - but = it didn't work. Searching for the error somewhere in the config files and it suddenly = dawned on me : The CCNet server was running .NET 2.0 and the dash and CCTray = .NET 1.1. So I switched the two apps to run .NET 2.0 as well and it worked! Phew. Hope it will solve the problem for others as well. +-------------------------------------------------------------------+ | Thomas Gravgaard | Fr=E6kheden ligger og fumler (__) | | Sotware Developer | ved dumhedens nosser. \\\'',) | | | Verden regeres af slyngler \/ \ ^| | fe...@go... | og landsbytosser. Halfdan R. .\._/_)| +-------------------------------------------------------------------+ | Blog : http://fehaar.blogspot.com/ | +-------------------------------------------------------------------+ |
|
From: Owen R. <exo...@gm...> - 2005-11-30 05:39:51
|
hi ian, On 29/11/05, Ian Olsen <ia...@so...> wrote: > > 1) i noticed that you changed username,password,repository and host int= o > required fields. > > what was the motivation for this change. i've been told by other vault > users that it is > > possible to 'deposit' these parameters with the vault server (though i'= m > unclear how > > exactly to do this. > > <smacks forehead> Wow, that's just an oversight on my part. I will chan= ge > these back to being optional. cool. though i'm still not too sure how to "deposit" these parameters. this question seems to come up periodically on the mailing list and it would be great to have a description of what this means on the confluence page. > > 2) i noticed your comment on the SetFileTime field. why do you suggest > that "current" is > > a more appropriate default value than "checkin"? my assumption is that > most users would > > like to see the time when the file was changed rather than the time whe= n > they updated > > -- though i could be misunderstanding these values. > > "Current" is the default in most of the source control tools I've ever us= ed > (including Vault), and I always assumed this was so that a compiler using > file dates to determine what needs compilation will behave as expected wh= en > you get source into an existing working folder, regardless of when that > source was checked in. (If I revert my working folder to a version of th= e > source last week, and don't do a "clean", everything will still build > correctly if we set the dates on the source files to current, and I still > get the speed benefits of an incremental build.) interesting point. i hadn't thought of it that way. > It seems to me this > matters less in a CI situation, as the source should be perpetually getti= ng > newer anyway, so the imposed "checkin" default doesn't bother me much. > Still, I thought letting people change this was a good idea so I added th= e > property. i agree. my question was more curiosity about the comment. > > 3) under what conditions would applylabel be true, but a label was not > applied? (ie. Why > > do we need the LabelApplied flag?) > > We recently implemented CC.NET for building Vault here at SourceGear, and= we > tested my changes as they progressed. One of the problems we had was mov= ing > from our old, home-grown build system we didn't quite cut over all at > the build numbers overlapped, and CC.NET tried to apply a label that alre= ady > existed. So Vault correctly complained, CC.NET correctly failed the buil= d, > and then CC.NET removed the label that the other build system had applied= , > which is bad. Perhaps this is a somewhat unique circumstance. However, = I > also didn't like that if a build failed for some other fundamental reason= , > like we had a bad host name configured, we'd get an error when checking f= or > mods and then another error when we tried to remove a label that had neve= r > been applied. Not a really big deal, but this makes errors in the log fi= le > in this scenario a bit less confusing, too. (And I'd wager that these > low-level configuration errors are probably quite common among people > setting up CC.NET for the first time, so making that less confusing is a > Good Thing.) thanks for the explanation. removing old labels would not be good.=20 let's keep it as implemented -- though what do you think about ammending the comment to explain *why* this property is in there? > > one consideration for removing labels if there has been an exception is > that the label > > will only be removed if publishExceptions is set to true on the <projec= t> > element. This > > is more of a ccnet problem than a vault problem, but i just wanted to m= ake > you aware of > > it. you can follow the logic in IntegrationRunner.PostBuild(). the wh= ole > way that ccnet > > deals with exceptions is something that needs to be better thought > through. > > I did notice this, and I agree that it's less than ideal where Vault is > concerned. I wasn't sure how to better handle this for Vault without mak= ing > some pretty radical CC.NET changes, so I made a note to simply explain it > well in the Vault source control block docs. that should be fine. as you mention, it's more of a required change for cc= net. > The way we're using labels to > ensure we get the right source for Vault now is an unfortunate hack, but = I > think it's the best option at this point in time. (And kudos to the > original submitter of that code for figuring that out.) We will likely > improve Vault's command-line client eventually so the label hack will no > longer be necessary, but we don't want people to have to wait for that. agreed. > > 4) for vss, currently the CleanCopy property indicates that Vss will > overwrite any changes > > to locally modified files. it does not mean that the working directory > will be deleted, > > which i believe the Vault implementation now does. now, i do think tha= t > deleting the > > working directory is useful behaviour -- it is a commonly requested > feature. but it is > > behaviour that i would like to be available uniformly across all > sourcecontrols. my > > original thought had been to put it into the project class; however, gi= ven > that > > sourcecontrols can override the working directory, this is not feasible= . > it seems like > > the current simplest option is to move this behaviour into a common > sourcecontrol base > > class. > > > for now, i'm content to leave it where it is as long as the overloaded = use > of the name > > CleanCopy doesn't confuse users. however, it would be nice to inject t= he > IoService class > > so that we don't need to test the file system through the unit tests. > CreateDirectory > > functionality can be added into this class. > > All good points. I thought I saw another Source Control class that was > deleting the working directory using the CleanCopy property, but I could = be > wrong about that. For now, maybe it makes sense to use another property > name so it can be used in the base SourceControl class? Any suggestions = for > a new name? actually, i think that it is fine as is, as long as the documentation is clear. i think that we should move more of the other source control providers to support this sort of behaviour. it does require a little bit more work to checkout a fresh copy of the source in svn/cvs; but it is behaviour that we should add. > I'll also move the CreateDirectory functionality to the > IoService class. If I understand you correctly, you'd also like me to mo= ve > all the IO stuff necessary for the unit tests to IoService? I can do tha= t > too. yes please. this makes the unit tests independent of the file system. this means that they run faster and they are less likely to fail due to unexpected environment issues. > > 5) for using the WorkingDirectory property, it is really important to u= se > > Integrationresult.BaseFromWorkingDirectory(). this means that we can u= se > relative paths > > throughout ccnet so that we only specify a single absolute path at the > project level. > > this makes the configuration much easier to manage. > > Another oversight by me. I'll do that. cheers. > > aside from all that, thanks for all your hard work on this. the > additional unit tests are > > a big help. > > Glad to help. We'll dog-food my changes for a few days, so I'll have a n= ew > patch late this week or early next. fine with me. it gives me a couple of days leeway to start processing other patches. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Ian O. <ia...@so...> - 2005-11-29 19:14:15
|
We apologize for the butchered formatting of the previous email. Those = responsible have been sacked. Legible repeat follows: Owen, Thanks for the feedback. My responses are inline below.=20 > 1) i noticed that you changed username,password,repository and host = into required fields. > what was the motivation for this change. i've been told by other = vault users that it is > possible to 'deposit' these parameters with the vault server (though = i'm unclear how=20 > exactly to do this. <smacks forehead> Wow, that's just an oversight on my part. I will = change these back to being optional. > 2) i noticed your comment on the SetFileTime field. why do you = suggest that "current" is=20 > a more appropriate default value than "checkin"? my assumption is = that most users would=20 > like to see the time when the file was changed rather than the time = when they updated > -- though i could be misunderstanding these values. "Current" is the default in most of the source control tools I've ever = used (including Vault), and I always assumed this was so that a compiler = using file dates to determine what needs compilation will behave as = expected when you get source into an existing working folder, regardless = of when that source was checked in. (If I revert my working folder to a = version of the source last week, and don't do a "clean", everything will = still build correctly if we set the dates on the source files to = current, and I still get the speed benefits of an incremental build.) = It seems to me this matters less in a CI situation, as the source should = be perpetually getting newer anyway, so the imposed "checkin" default = doesn't bother me much. Still, I thought letting people change this was = a good idea so I added the property. > 3) under what conditions would applylabel be true, but a label was not = applied? (ie. Why > do we need the LabelApplied flag?) We recently implemented CC.NET for building Vault here at SourceGear, = and we tested my changes as they progressed. One of the problems we had = was moving from our old, home-grown build system we didn't quite cut = over all at once, the build numbers overlapped, and CC.NET tried to = apply a label that already existed. So Vault correctly complained, = CC.NET correctly failed the build, and then CC.NET removed the label = that the other build system had applied, which is bad. Perhaps this is = a somewhat unique circumstance. However, I also didn't like that if a = build failed for some other fundamental reason, like we had a bad host = name configured, we'd get an error when checking for mods and then = another error when we tried to remove a label that had never been = applied. Not a really big deal, but this makes errors in the log file = in this scenario a bit less confusing, too. (And I'd wager that these = low-level configuration errors are probably quite common among people = setting up CC.NET for the first time, so making that less confusing is a = Good Thing.) > one consideration for removing labels if there has been an exception = is that the label=20 > will only be removed if publishExceptions is set to true on the = <project> element. This=20 > is more of a ccnet problem than a vault problem, but i just wanted to = make you aware of=20 > it. you can follow the logic in IntegrationRunner.PostBuild(). the = whole way that ccnet=20 > deals with exceptions is something that needs to be better thought = through. I did notice this, and I agree that it's less than ideal where Vault is = concerned. I wasn't sure how to better handle this for Vault without = making some pretty radical CC.NET changes, so I made a note to simply = explain it well in the Vault source control block docs. The way we're = using labels to ensure we get the right source for Vault now is an = unfortunate hack, but I think it's the best option at this point in = time. (And kudos to the original submitter of that code for figuring = that out.) We will likely improve Vault's command-line client = eventually so the label hack will no longer be necessary, but we don't = want people to have to wait for that. > 4) for vss, currently the CleanCopy property indicates that Vss will = overwrite any changes=20 > to locally modified files. it does not mean that the working = directory will be deleted,=20 > which i believe the Vault implementation now does. now, i do think = that deleting the=20 > working directory is useful behaviour -- it is a commonly requested = feature. but it is > behaviour that i would like to be available uniformly across all = sourcecontrols. my=20 > original thought had been to put it into the project class; however, = given that=20 > sourcecontrols can override the working directory, this is not = feasible. it seems like=20 > the current simplest option is to move this behaviour into a common = sourcecontrol base > class. > for now, i'm content to leave it where it is as long as the overloaded = use of the name=20 > CleanCopy doesn't confuse users. however, it would be nice to inject = the IoService class=20 > so that we don't need to test the file system through the unit tests. = CreateDirectory=20 > functionality can be added into this class. All good points. I thought I saw another Source Control class that was = deleting the working directory using the CleanCopy property, but I could = be wrong about that. For now, maybe it makes sense to use another = property name so it can be used in the base SourceControl class? Any = suggestions for a new name? I'll also move the CreateDirectory = functionality to the IoService class. If I understand you correctly, = you'd also like me to move all the IO stuff necessary for the unit tests = to IoService? I can do that too. > 5) for using the WorkingDirectory property, it is really important to = use=20 > Integrationresult.BaseFromWorkingDirectory(). this means that we can = use relative paths > throughout ccnet so that we only specify a single absolute path at the = project level. =20 > this makes the configuration much easier to manage. Another oversight by me. I'll do that. > aside from all that, thanks for all your hard work on this. the = additional unit tests are=20 > a big help. Glad to help. We'll dog-food my changes for a few days, so I'll have a = new patch late this week or early next. --- Ian Olsen Developer SourceGear |
|
From: Ian O. <ia...@so...> - 2005-11-29 16:13:38
|
Owen, Thanks for the feedback. My responses are inline below. > 1) i noticed that you changed username,password,repository and host into required fields. > what was the motivation for this change. i've been told by other vault users that it is > possible to 'deposit' these parameters with the vault server (though i'm unclear how > exactly to do this. <smacks forehead> Wow, that's just an oversight on my part. I will change these back to being optional. > 2) i noticed your comment on the SetFileTime field. why do you suggest that "current" is > a more appropriate default value than "checkin"? my assumption is that most users would > like to see the time when the file was changed rather than the time when they updated > -- though i could be misunderstanding these values. "Current" is the default in most of the source control tools I've ever used (including Vault), and I always assumed this was so that a compiler using file dates to determine what needs compilation will behave as expected when you get source into an existing working folder, regardless of when that source was checked in. (If I revert my working folder to a version of the source last week, and don't do a "clean", everything will still build correctly if we set the dates on the source files to current, and I still get the speed benefits of an incremental build.) It seems to me this matters less in a CI situation, as the source should be perpetually getting newer anyway, so the imposed "checkin" default doesn't bother me much. Still, I thought letting people change this was a good idea so I added the property. > 3) under what conditions would applylabel be true, but a label was not applied? (ie. Why > do we need the LabelApplied flag?) We recently implemented CC.NET for building Vault here at SourceGear, and we tested my changes as they progressed. One of the problems we had was moving from our old, home-grown build system we didn't quite cut over all at once, the build numbers overlapped, and CC.NET tried to apply a label that already existed. So Vault correctly complained, CC.NET correctly failed the build, and then CC.NET removed the label that the other build system had applied, which is bad. Perhaps this is a somewhat unique circumstance. However, I also didn't like that if a build failed for some other fundamental reason, like we had a bad host name configured, we'd get an error when checking for mods and then another error when we tried to remove a label that had never been applied. Not a really big deal, but this makes errors in the log file in this scenario a bit less confusing, too. (And I'd wager that these low-level configuration errors are probably quite common among people setting up CC.NET for the first time, so making that less confusing is a Good Thing.) > one consideration for removing labels if there has been an exception is that the label > will only be removed if publishExceptions is set to true on the <project> element. This > is more of a ccnet problem than a vault problem, but i just wanted to make you aware of > it. you can follow the logic in IntegrationRunner.PostBuild(). the whole way that ccnet > deals with exceptions is something that needs to be better thought through. I did notice this, and I agree that it's less than ideal where Vault is concerned. I wasn't sure how to better handle this for Vault without making some pretty radical CC.NET changes, so I made a note to simply explain it well in the Vault source control block docs. The way we're using labels to ensure we get the right source for Vault now is an unfortunate hack, but I think it's the best option at this point in time. (And kudos to the original submitter of that code for figuring that out.) We will likely improve Vault's command-line client eventually so the label hack will no longer be necessary, but we don't want people to have to wait for that. > 4) for vss, currently the CleanCopy property indicates that Vss will overwrite any changes > to locally modified files. it does not mean that the working directory will be deleted, > which i believe the Vault implementation now does. now, i do think that deleting the > working directory is useful behaviour -- it is a commonly requested feature. but it is > behaviour that i would like to be available uniformly across all sourcecontrols. my > original thought had been to put it into the project class; however, given that > sourcecontrols can override the working directory, this is not feasible. it seems like > the current simplest option is to move this behaviour into a common sourcecontrol base > class. > for now, i'm content to leave it where it is as long as the overloaded use of the name > CleanCopy doesn't confuse users. however, it would be nice to inject the IoService class > so that we don't need to test the file system through the unit tests. CreateDirectory > functionality can be added into this class. All good points. I thought I saw another Source Control class that was deleting the working directory using the CleanCopy property, but I could be wrong about that. For now, maybe it makes sense to use another property name so it can be used in the base SourceControl class? Any suggestions for a new name? I'll also move the CreateDirectory functionality to the IoService class. If I understand you correctly, you'd also like me to move all the IO stuff necessary for the unit tests to IoService? I can do that too. > 5) for using the WorkingDirectory property, it is really important to use > Integrationresult.BaseFromWorkingDirectory(). this means that we can use relative paths > throughout ccnet so that we only specify a single absolute path at the project level. > this makes the configuration much easier to manage. Another oversight by me. I'll do that. > aside from all that, thanks for all your hard work on this. the additional unit tests are > a big help. Glad to help. We'll dog-food my changes for a few days, so I'll have a new patch late this week or early next. --- Ian Olsen Developer SourceGear |
|
From: Campbell, C. <Cra...@la...> - 2005-11-29 15:59:46
|
=20 > i had a quick scan through the code, but i'm not sure what charting library you are using. i'm probably missing it. it looks like it should be > in ThoughtWorks.CruiseControl.WebDashboard.Plugins.Charts, but i don't see this in there. That's because I forgot to include it, my bad. Here it is. This email, and any files previous email messages included with it, may = contain confidential and/or privileged material. If you are not the = intended recipient please contact the sender and delete all copies. |
|
From: Owen R. <exo...@gm...> - 2005-11-29 07:40:15
|
hi ian, On 28/11/05, Ian Olsen <ia...@so...> wrote: > The attached zip (renamed so the list will accept it) contains changes > related to SourceGear Vault integration in CC.NET. Per Owen's suggestion > with respect to the delayed updates for anonymous cvs acccess, I've just > attached the full files. The updated unit test classes are also included= . thanks for the patch! i'm starting to go through and process it and i have a number of questions: 1) i noticed that you changed username,password,repository and host into required fields. what was the motivation for this change. i've been told by other vault users that it is possible to 'deposit' these parameters with the vault server (though i'm unclear how exactly to do this. 2) i noticed your comment on the SetFileTime field. why do you suggest that "current" is a more appropriate default value than "checkin"? my assumption is that most users would like to see the time when the file was changed rather than the time when they updated -- though i could be misunderstanding these values. 3) under what conditions would applylabel be true, but a label was not applied? (ie. why do we need the LabelApplied flag?) one consideration for removing labels if there has been an exception is that the label will only be removed if publishExceptions is set to true on the <project> element. this is more of a ccnet problem than a vault problem, but i just wanted to make you aware of it. you can follow the logic in IntegrationRunner.PostBuild(). the whole way that ccnet deals with exceptions is something that needs to be better thought through. 4) for vss, currently the CleanCopy property indicates that Vss will overwrite any changes to locally modified files. it does not mean that the working directory will be deleted, which i believe the Vault implementation now does. now, i do think that deleting the working directory is useful behaviour -- it is a commonly requested feature.=20 but it is behaviour that i would like to be available uniformly across all sourcecontrols. my original thought had been to put it into the project class; however, given that sourcecontrols can override the working directory, this is not feasible. it seems like the current simplest option is to move this behaviour into a common sourcecontrol base class. for now, i'm content to leave it where it is as long as the overloaded use of the name CleanCopy doesn't confuse users. however, it would be nice to inject the IoService class so that we don't need to test the file system through the unit tests. CreateDirectory functionality can be added into this class. 5) for using the WorkingDirectory property, it is really important to use Integrationresult.BaseFromWorkingDirectory(). this means that we can use relative paths throughout ccnet so that we only specify a single absolute path at the project level. this makes the configuration much easier to manage. aside from all that, thanks for all your hard work on this. the additional unit tests are a big help. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Owen R. <exo...@gm...> - 2005-11-29 05:58:50
|
hi francis, On 28/11/05, Francis Tremblay <fra...@gm...> wrote: > This patch.txt is filled with : > - Alienbrain.cs and AlienbrainHistoryParser.cs to support Alienbrain > (tested on version 7) > - Alienbraintest.cs and AlienbrainHistoryParser.cs unit tests > - Fixes to support filters > > Also, here's the updated documentation thanks for all the hard work you've put into this. i've uploaded your changes onto the existing jira: http://jira.public.thoughtworks.org/browse/CCNET-385 and i will start processing this soon. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Owen R. <exo...@gm...> - 2005-11-29 05:53:26
|
hi craig, On 28/11/05, Campbell, Craig <Cra...@la...> wrote: > While we are discussing graphs I would like to throw out another idea > for discussion. > > I have been playing with statistics for upper management and have > completed a preliminary page for both project metrics and farm metrics > with pie and line charts (screen shot included in attached archive). very cool. thanks for contributing this stuff back. i had a quick scan through the code, but i'm not sure what charting library you are using. i'm probably missing it. it looks like it should be in ThoughtWorks.CruiseControl.WebDashboard.Plugins.Charts, but i don't see this in there. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Campbell, C. <Cra...@la...> - 2005-11-28 22:54:22
|
While we are discussing graphs I would like to throw out another idea for discussion. I have been playing with statistics for upper management and have completed a preliminary page for both project metrics and farm metrics with pie and line charts (screen shot included in attached archive). The one major difference is that it uses a database to collect the metrics and arrange the numbers in a meaningful way. The prototype was done with SQL Server 2000, but I have tested it with SQL Server Express 2005 (the free version) without any problems. Unfortunately I haven't done any testing with MySQL or any other database. I tried to stay away from the SQL Server specific stuff only used tables, functions, views and sprocs. There is one SQL Server specific function that I had to write to get the correct date format for the 'Builds per Day' graph and table, but that should be the only one (I think). However, with that said, it doesn't need to have a database to run, the numbers can be gleaned from reading the log files and building the information on the fly (there is a major performance enhancement using a db though). This was a quick job with most of the time spent on the database functions, views, sprocs, and tables so there is definite improvement that can be made on the metrics interface so that multiple options can be included (database, no database, someother data source, etc.). This is mostly for discussion, although I have attached the code for anybody who wants to use it. This is the first of a few changes to use a database that I am investigating. Once the code is in place the only other changes are to the dashboard.config (under WebDashboard) and the app.config (under console). The dashboard.config has to include the plugins and a change to the remoting tag to include the database connection stuff. While the app.config needs to include an app setting key DatabaseConnectionString with the value being the appropriate connection string. Thanks, Craig This email, and any files previous email messages included with it, may = contain confidential and/or privileged material. If you are not the = intended recipient please contact the sender and delete all copies. |
|
From: Perry I. <ism...@gm...> - 2005-11-28 20:50:58
|
On 11/28/05, Ian Olsen <ia...@so...> wrote: > The attached zip (renamed so the list will accept it) contains changes > related to SourceGear Vault integration in CC.NET. Per Owen's suggestion > with respect to the delayed updates for anonymous cvs acccess, I've just > attached the full files. The updated unit test classes are also included= . Ian, great stuff. You're making us Vault users really glad we chose the product... -- Perry Ismangil |
|
From: Francis T. <fra...@gm...> - 2005-11-28 18:39:58
|
Hi, This patch.txt is filled with : - Alienbrain.cs and AlienbrainHistoryParser.cs to support Alienbrain (tested on version 7) - Alienbraintest.cs and AlienbrainHistoryParser.cs unit tests - Fixes to support filters Also, here's the updated documentation -- Francis Tremblay |
|
From: Ian O. <ia...@so...> - 2005-11-28 17:37:40
|
The attached zip (renamed so the list will accept it) contains changes related to SourceGear Vault integration in CC.NET. Per Owen's suggestion with respect to the delayed updates for anonymous cvs acccess, I've just attached the full files. The updated unit test classes are also included. Specifically, this addresses the following issues in Jira: CCNET-613: failure to label isn't handled correctly CCNET-614: useWorkingFolder with label isn't handled correctly CCNET-615: adds and deletes aren't correctly parsed when checking mods, so you can't filter them CCNET-616: logging is confusing when using multiple source control blocks CCNET-617: "checkin" for date/time on retrieved files is hard-coded CCNET-618: can't empty source folder before retrieval There are relevant documentation changes, which I'm happy to make, but it probably makes sense to wait until the patch has been accepted? Thanks, --- Ian Olsen Developer SourceGear |
|
From: Jay F. <jay...@gm...> - 2005-11-28 00:56:02
|
Rars and zips are not allowed through. Re-send it with the file extension altered. Thanks -- Jay Flowers ---------------------------------------------------------------------- http://jayflowers.com --------------------------------------------------------------------- |
|
From: James B. <jam...@gm...> - 2005-11-28 00:21:05
|
Did these files get sent appropriately? I could not open the rar file. Thanks, JEB Alexander Luetjen wrote: > > Hi there, > > > > I developed small, simple SharePoint Web Part to display CCNet status. > > > > If it is of interest to someone please tell me where to post it….put > not sooo intersted in messing around with CVS ;) > > > Regards, Alex > |
|
From: ANTIGEN A. (UAI) <an...@ua...> - 2005-11-27 21:25:19
|
Antigen Antivirus for Exchange found CCNetStatusWebPart.rar matching FILE FILTER= *.rar file filter. The file is currently Removed. The message, "Fwd: [Ccnet-devel] MSSPS Web Part to display CCNet status", was sent from ccn...@li... and was discovered in IMC Queues\Inbound located at uaintegrators.com/mail/HERMES. ------------------------------------- This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. |
|
From: Postmaster <pos...@me...> - 2005-11-27 21:25:19
|
An Internet e-mail message was sent to you from an outside source that
contained an prohibited file type, but was removed for security
purposes.
The message header is attached below. If you must use e-mail to receive
business-related .exe files, there is a workaround. Please inform the
sender of the Internet Message to create a password protected zip file
as explained in the steps below. For assistance with this procedure,
please contact your local helpdesk.
1. Go to Start...Programs...WinZip
2. Click [New]
3. For "File name", type desired file name for the new compressed
file
4. For "Create In". browse to desired location to save newly
compressed file
5. Click to check box next to "Add Dialog"
6. Click [OK]
7. For "Add from", browse to location of file(s) to compress
8. Select file(s) to be compressed
9. Click [Password]
9a. For "Password", type desired password
9b. Click [OK]
9c. For "Please reenter your password", retype your password
9d. Click [OK]
10. Click [Add]
11. After creating the file, close the WinZip window, if open.
12. Open Windows Explorer and locate the .zip file created in steps 1 -
10.
13. Right-click on the file name and select Rename from the shortcut
menu.
14. Modify the last 3 letters (known as the file extension) of the file
name to .zi_.
Example: ABC.zip becomes file ABC.zi_
15. In Outlook, compose a new message and select Insert...File to
attach the .zi_ file to your message.
Sender: "Alexander Luetjen" <ccn...@li...>
Date: 11/27/05, 16:25:07
Attachments: CCNetStatusWebPart.rar
|
|
From: Jay F. <jay...@gm...> - 2005-11-27 20:11:48
|
SSBhbSEKCk9uIDExLzI3LzA1LCBBbGV4YW5kZXIgTHVldGplbiA8bHVldGplbkBnb29nbGVtYWls LmNvbT4gd3JvdGU6Cj4KPgo+IEhpIHRoZXJlLAo+Cj4KPgo+IEkgZGV2ZWxvcGVkIHNtYWxsLCBz aW1wbGUgU2hhcmVQb2ludCBXZWIgUGFydCB0byBkaXNwbGF5IENDTmV0IHN0YXR1cy4KPgo+Cj4g SWYgaXQgaXMgb2YgaW50ZXJlc3QgdG8gc29tZW9uZSBwbGVhc2UgdGVsbCBtZSB3aGVyZSB0byBw b3N0IGl0hS5wdXQgbm90Cj4gc29vbyBpbnRlcnN0ZWQgaW4gbWVzc2luZyBhcm91bmQgd2l0aCBD VlMgOykKPgo+Cj4gUmVnYXJkcywgQWxleAoKCi0tCkpheSBGbG93ZXJzCi0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0K aHR0cDovL2pheWZsb3dlcnMuY29tCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQo= |
|
From: Alexander L. <lu...@go...> - 2005-11-27 19:50:51
|
SGkgdGhlcmUsCgoKCkkgZGV2ZWxvcGVkIHNtYWxsLCBzaW1wbGUgU2hhcmVQb2ludCBXZWIgUGFy dCB0byBkaXNwbGF5IENDTmV0IHN0YXR1cy4KCgpJZiBpdCBpcyBvZiBpbnRlcmVzdCB0byBzb21l b25lIHBsZWFzZSB0ZWxsIG1lIHdoZXJlIHRvIHBvc3QgaXSFLnB1dCBub3QKc29vbyBpbnRlcnN0 ZWQgaW4gbWVzc2luZyBhcm91bmQgd2l0aCBDVlMgOykKCgpSZWdhcmRzLCBBbGV4Cg== |
|
From: Westerdale, D. <Dan...@uk...> - 2005-11-25 13:33:46
|
>s I understand it, there are two different products called NCover. >One that does its spelunking in run-time [1] and one that instruments the >source code prior to compilation [2]. >Yours appears to be [1], since the other is still at a pre-1.0 version, so I >wouldn't attempt to use it for source instrumentation. >Can't help with the real issue, sorry. >- Kim >[1] http://www.ncover.org/ <http://www.ncover.org/> >[2] http://ncover.sourceforge.net/ <http://ncover.sourceforge.net/> Kim, Thanks for clearing this up. I had previously thought the same thing. The Java community doesn't suffer from projects ( JDOM, Spring etc) with split personalities so neither should we! Anyway, it looks like [1] is the one I should be using as it appears to be actively being developed. However, If I can't get it to work: see my tales of woe at http://www.ncover.org/COMMUNITY/ShowForum.aspx?ForumID=14 <http://www.ncover.org/COMMUNITY/ShowForum.aspx?ForumID=14> .then I am stuffed so I need to be looking at [2]. If so what are the disadvantages and levels of integration with CC.NET. I can't believe I am the only one who can't get NCover to work either with ccnet.build or in a simple .bat file. cheers Daniel This e-mail has come from Experian, winner of the UK's 'Business of the Year' 2003 and 2005. ========================================================================== Information in this e-mail and any attachments are confidential, and may not be copied or used by anyone other than the addressee, nor disclosed to any third party without our permission. There is no intention to create any legally binding contract or other binding commitment through the use of this electronic communication unless it is issued in accordance with the Experian Limited standard terms and conditions of purchase or other express written agreement between Experian Limited and the recipient Experian Limited (registration number 653331) Registered office: Talbot House, Talbot Street, Nottingham NG80 1TH Although Experian has taken reasonable steps to ensure that this communication and any attachments are free from computer virus, you are advised to take your own steps to ensure that they are actually virus free. |
|
From: Mike R. <mik...@gm...> - 2005-11-24 15:24:01
|
I actually paired with one of the spring.net guys the other week looking at replacing my DI (Dependency Injection) framework in the Dashboard with Spring.NET . Unfortunately we're using DI in a way that Spring.NET can't support. Mike On 11/24/05, Thibaut Barr=E8re <thi...@gm...> wrote: > Hi, > > I mean... Your opinion about using spring.net inside ccnet ? > > (I have no strict opinion myself at all, I'm just starting to use > spring.net in my real life projects and like the benefits it brings in te= rm > of customisation for instance...) > > Thibaut > > > -- mike roberts | http://mikeroberts.thoughtworks.net/ | http://www.thoughtworks.com/ |
|
From: <thi...@gm...> - 2005-11-24 14:32:12
|
Hi, I mean... Your opinion about using spring.net inside ccnet ? (I have no strict opinion myself at all, I'm just starting to use spring.netin my real life projects and like the benefits it brings in term of customisation for instance...) Thibaut |
|
From: Owen R. <exo...@gm...> - 2005-11-24 06:02:36
|
hi richard, On 23/11/05, Foster, Richard - PAL <RF...@qu...> wrote: > It does indeed help. I've also updated the ForceBuildPublisher to > include a reference to it as an alternate triggering method. thanks. > Should I > also add a link back from the ProjectTrigger to the ForceBuildPublisher, > or are there plans to retire the latter? no plans to retire the publisher. i think that it is useful to have both options. please feel free to update the docs however you think is best. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Owen R. <exo...@gm...> - 2005-11-24 03:28:19
|
hi francis, On 23/11/05, Francis Tremblay <fra...@gm...> wrote: > As promise, here's code, some unittest and documentation to support > Alienbrain source control. thanks for the patch. i'll have a look at it this week. cheers, owen. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Francis T. <fra...@gm...> - 2005-11-24 00:44:53
|
*** Wed Dec 31 14:00:00 1969 *** Wed Dec 31 14:00:00 1969 *** project/core/sourcecontrol/Alienbrain.cs Wed Dec 31 14:00:00 1969 --- project/core/sourcecontrol/Alienbrain.cs Wed Nov 23 15:47:07 2005 *************** *** 0 **** --- 1,180 ---- + using System; + using System.Globalization; + using System.IO; + using Exortech.NetReflector; + using ThoughtWorks.CruiseControl.Core.Util; + + namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol + { + [ReflectorType("alienbrain")] + public class Alienbrain : ProcessSourceControl + { + + public static readonly string NO_CHANGE = "No files or folders found!"; + + public const string AB_REGISTRY_PATH = @"SOFTWARE\NxN\alienbrain"; + public const string AB_REGISTRY_KEY = "InstallDir"; + public const string AB_COMMMAND_PATH = @"Client\Application\Tools"; + public const string AB_EXE = "ab.exe"; + + public const string BRANCH_COMMAND_TEMPLATE = @"setactivebranch ""{0}"" -s ""{1}"" -d ""{2}"" -u ""{3}"" -p ""{4}"""; + public const string MODIFICATIONS_COMMAND_TEMPLATE = @"find ""{0}"" -s ""{1}"" -d ""{2}"" -u ""{3}"" -p ""{4}"" -regex ""SCIT > {5} AND SCIT < {6}"" -format ""#CheckInComment#|#Name#|#DbPath#|#SCIT#|#Mime Type#|#LocalPath#|#Changed By#|#NxN_VersionNumber#"""; + public const string LABEL_COMMAND_TEMPLATE = @"setlabel ""{0}"" -s ""{1}"" -d ""{2}"" -u ""{3}"" -p ""{4}"" -name ""{5}"" -comment ""This label is brought to you by CruiseControl.NET"""; + public const string GET_COMMAND_TEMPLATE = @"getlatest ""{0}"" -s ""{1}"" -d ""{2}"" -u ""{3}"" -p ""{4}"" -localpath ""{5}"" -overwritewritable replace -overwritecheckedout replace -response:GetLatest.PathInvalid y -response:GetLatest.Writable y -response:GetLatest.CheckedOut y"; + + private IRegistry registry; + private readonly ProcessExecutor processExecutor; + private string executable; + + public Alienbrain() : this(new AlienbrainHistoryParser(), new ProcessExecutor(), new Registry()) + { + processExecutor = new ProcessExecutor(); + } + + public Alienbrain(IHistoryParser parser, ProcessExecutor executor, IRegistry registry) : base(parser, executor) + { + this.registry = registry; + } + + //done + [ReflectorProperty("executable",Required = false)] + public string Executable + { + get + { + if (executable == string.Empty || executable == null) + executable = GetExecutableFromRegistry(); + return executable; + } + set { executable = value; } + } + + [ReflectorProperty("server")] + public string Server = string.Empty; + + [ReflectorProperty("database")] + public string Database = string.Empty; + + [ReflectorProperty("username")] + public string Username = string.Empty; + + [ReflectorProperty("password")] + public string Password = string.Empty; + + [ReflectorProperty("branch", Required = false)] + public string Branch = string.Empty; + + [ReflectorProperty("project", Required = true)] + public string Project = string.Empty; + + [ReflectorProperty("autoGetSource", Required = false)] + public bool AutoGetSource = false; + + [ReflectorProperty("workingDirectory", Required = false)] + public string WorkingDirectory = string.Empty; + + [ReflectorProperty("labelOnSuccess", Required=false)] + public bool LabelOnSuccess = false; + + // Actions + // + // I had to bake something here because Alienbrain return ERRORLEVEL 1 when nothing is found + // that caused an exception in CruiseControl.NET that think that the process failed (not pretty in the logs) + // So I'm checking the result to see if there is changes, if not I return nothing + public override Modification[] GetModifications(IIntegrationResult from, IIntegrationResult to) + { + ProcessInfo processinfo = createModificationProcess( MODIFICATIONS_COMMAND_TEMPLATE, from.StartTime, to.StartTime); + ProcessResult result = processExecutor.Execute(processinfo); + if (!result.StandardOutput.TrimEnd().EndsWith(NO_CHANGE)) + { + return base.ParseModifications(result, from.StartTime, to.StartTime); + } + else + { + return null; + } + } + + public override void LabelSourceControl(IIntegrationResult result) + { + + ProcessInfo process; + + if (LabelOnSuccess && result.Succeeded) + { + SelectBranch(); + + process = createLabelProcess( LABEL_COMMAND_TEMPLATE, result ); + Log.Info(string.Format("Setting a Label on Alienbrain: {0} {1}", process.FileName, process.Arguments)); + Execute(process); + } + + } + + public override void GetSource(IIntegrationResult result) + { + ProcessInfo process; + + if (AutoGetSource == true) + { + + SelectBranch(); + + process = createGetProcess( GET_COMMAND_TEMPLATE ); + Log.Info(string.Format("Getting source from Alienbrain: {0} {1}", process.FileName, process.Arguments)); + Execute(process); + } + } + + private string GetExecutableFromRegistry() + { + string comServerPath = registry.GetExpectedLocalMachineSubKeyValue(AB_REGISTRY_PATH, AB_REGISTRY_KEY); + return Path.Combine(comServerPath, AB_COMMMAND_PATH + "\\" + AB_EXE); + } + + public void SelectBranch() + { + ProcessInfo process; + if ( Branch != string.Empty ) + { + process = createBranchProcess( BRANCH_COMMAND_TEMPLATE ); + Log.Info(string.Format("Changing the branch on Alienbrain: {0} {1}", process.FileName, process.Arguments)); + Execute(process); + } + } + + + public bool HasChanges(ProcessInfo p) + { + ProcessResult result = processExecutor.Execute(p); + return !result.StandardOutput.TrimEnd().EndsWith(NO_CHANGE); + } + + + // Process Creations + + public ProcessInfo createModificationProcess(string processCommand, DateTime from, DateTime to) + { + string arguments = String.Format( processCommand, Project, Server, Database, Username, Password, from.ToFileTime(), to.ToFileTime() ); + return new ProcessInfo(Executable, arguments); + } + + public ProcessInfo createLabelProcess(string processCommand, IIntegrationResult result) + { + string arguments = String.Format( processCommand, Project, Server, Database, Username, Password, result.Label ); + return new ProcessInfo(Executable, arguments); + } + + public ProcessInfo createGetProcess(string processCommand) + { + string arguments = String.Format( processCommand, Project, Server, Database, Username, Password, WorkingDirectory); + return new ProcessInfo(Executable, arguments); + } + + public ProcessInfo createBranchProcess(string processCommand) + { + string arguments = String.Format( processCommand, Branch, Server, Database, Username, Password ); + return new ProcessInfo(Executable, arguments); + } + } + } \ No newline at end of file *** project/core/sourcecontrol/AlienbrainHistoryParser.cs Wed Dec 31 14:00:00 1969 --- project/core/sourcecontrol/AlienbrainHistoryParser.cs Wed Nov 23 12:10:23 2005 *************** *** 0 **** --- 1,84 ---- + using System; + using System.Collections; + using System.IO; + using System.Text.RegularExpressions; + using ThoughtWorks.CruiseControl.Core.Util; + + namespace ThoughtWorks.CruiseControl.Core.Sourcecontrol + { + public class AlienbrainHistoryParser : IHistoryParser + { + + public static readonly string FILE_REGEX = ".*|.*|.*|.*|.*|.*|.*|.*"; + public static readonly char DELIMITER = '|'; + public AlienbrainHistoryParser() + { + } + + public Modification[] Parse(TextReader history, DateTime from, DateTime to) + { + string historyLog = history.ReadToEnd(); + + Regex regex = new Regex(Alienbrain.NO_CHANGE); + if (regex.Match(historyLog).Success == true) + { + return null; + } + else + { + regex = new Regex(FILE_REGEX); + ArrayList result = new ArrayList(); + string oldfile = ","; + + for (Match match = regex.Match(historyLog); match.Success; match = match.NextMatch()) + { + string[] modificationParams = AllModificationParams(match.Value); + if (modificationParams.Length > 1) + { + string file = modificationParams[1]; + if (file != oldfile) + { + result.Add(ParseModification(modificationParams)); + oldfile = file; + } + } + } + return (Modification[]) result.ToArray(typeof (Modification)); + } + + } + + // strip carriage return, new line, and all leading and trailing characters from parameters + public string[] AllModificationParams(string matchedLine) + { + matchedLine = matchedLine.Replace("\n", ""); + matchedLine = matchedLine.Replace("\r", ""); + string[] modificationParams = matchedLine.Split(DELIMITER); + for (int ii = 0; ii < modificationParams.Length; ii++) + { + modificationParams[ii] = modificationParams[ii].Trim(' '); + } + return modificationParams; + } + + public Modification ParseModification(string[] modificationParams) + { + Modification modification = new Modification(); + + // #CheckInComment#|#Name#|#DbPath#|#SCIT#|#Mime Type#|#LocalPath#|#Changed By#|#NxN_VersionNumber# + //modification.ChangeNumber = ""; + modification.Comment = modificationParams[0]; + //modification.EmailAddress = ""; + modification.FileName = modificationParams[1]; + modification.FolderName = modificationParams[2].Replace("/" + modificationParams[1],""); + modification.ModifiedTime = DateTime.FromFileTime( long.Parse(modificationParams[3]) ); + modification.Type = modificationParams[4]; + modification.Url = modificationParams[5]; + modification.UserName = modificationParams[6]; + modification.Version = modificationParams[7]; + + return modification; + + } + } + } \ No newline at end of file *** project/UnitTests/Core/SourceControl/AlienbrainHistoryParserTest.cs Wed Dec 31 14:00:00 1969 --- project/UnitTests/Core/SourceControl/AlienbrainHistoryParserTest.cs Wed Nov 23 12:04:28 2005 *************** *** 0 **** --- 1,97 ---- + using System; + using System.IO; + using NUnit.Framework; + using ThoughtWorks.CruiseControl.Core; + using ThoughtWorks.CruiseControl.Core.Sourcecontrol; + + namespace ThoughtWorks.CruiseControl.UnitTests.Core.Sourcecontrol + { + [TestFixture] + public class AlienbrainHistoryParserTest + { + AlienbrainHistoryParser parser; + + // #CheckInComment#|#Name#|#DbPath#|#SCIT#|#Mime Type#|#LocalPath#|#Changed By#|#NxN_VersionNumber# + const string CHECKINCOMMENT = "Fixed Crash"; + const string NAME = "UnNativeScript.cpp"; + const string DBPATH = "/Code/Core/Src/UnNativeScript.cpp"; + const string DBPATH_NOFILENAME = "/Code/Core/Src"; + const long SCIT = 127771952139476549; + const string MIME_TYPE = "C++ Implementation File"; + const string LOCALPATH = @"d:\project\code\Core\Src\UnNativeScript.cpp"; + const string CHANGED_BY = "luke"; + const string NXN_VERSIONNUMBER = "6"; + + // #CheckInComment#|#Name#|#DbPath#|#SCIT#|#Mime Type#|#LocalPath#|#Changed By#|#NxN_VersionNumber# + private const string COMMAND_OUTPUT_FORMAT = "{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}\r\n"; + + + private static string[] SAMPLE_PARAMS = {CHECKINCOMMENT, NAME, DBPATH, SCIT.ToString(), MIME_TYPE, LOCALPATH, CHANGED_BY, NXN_VERSIONNUMBER }; + private static string SAMPLE_ONE_LINES = string.Format( COMMAND_OUTPUT_FORMAT, CHECKINCOMMENT, NAME, DBPATH, SCIT.ToString(), MIME_TYPE, + LOCALPATH, CHANGED_BY, NXN_VERSIONNUMBER ); + + private static string SAMPLE_TWO_LINES = string.Format("{0}\n{1}", SAMPLE_ONE_LINES, SAMPLE_ONE_LINES); + private static string SAMPLE_NO_CHANGES = string.Format("{0}\n{1}", "", Alienbrain.NO_CHANGE); + + [SetUp] + protected void Setup() + { + parser = new AlienbrainHistoryParser(); + } + + [Test] + public void CanParseModifications() + { + Modification tokens = parser.ParseModification( SAMPLE_PARAMS ); + + Assert.AreEqual( CHECKINCOMMENT, tokens.Comment ); + Assert.AreEqual( NAME, tokens.FileName ); + Assert.AreEqual( DBPATH_NOFILENAME, tokens.FolderName ); + Assert.AreEqual( DateTime.FromFileTime( SCIT ), tokens.ModifiedTime ); + Assert.AreEqual( MIME_TYPE, tokens.Type ); + Assert.AreEqual( LOCALPATH, tokens.Url ); + Assert.AreEqual( CHANGED_BY, tokens.UserName ); + Assert.AreEqual( NXN_VERSIONNUMBER, tokens.Version ); + } + + [Test] + public void CanExtractParamsFromOneLine() + { + string[] tokens = parser.AllModificationParams( SAMPLE_ONE_LINES ); + + Assert.AreEqual( 8 , tokens.Length); + Assert.AreEqual( CHECKINCOMMENT, tokens[ 0 ]); + Assert.AreEqual( NAME, tokens[ 1 ] ); + Assert.AreEqual( DBPATH, tokens[ 2 ] ); + Assert.AreEqual( SCIT.ToString(), tokens[ 3 ] ); + Assert.AreEqual( MIME_TYPE, tokens[ 4 ] ); + Assert.AreEqual( LOCALPATH, tokens[ 5 ] ); + Assert.AreEqual( CHANGED_BY, tokens[ 6 ] ); + Assert.AreEqual( NXN_VERSIONNUMBER, tokens[ 7 ] ); + + } + + [Test] + public void CanExtractParamsFromMultipleLines() + { + Modification modification = parser.Parse(new StringReader( SAMPLE_TWO_LINES ), DateTime.Now, DateTime.Now)[0]; + + Assert.AreEqual( CHECKINCOMMENT, modification.Comment ); + Assert.AreEqual( NAME, modification.FileName ); + Assert.AreEqual( DBPATH_NOFILENAME, modification.FolderName ); + Assert.AreEqual( DateTime.FromFileTime( SCIT ), modification.ModifiedTime ); + Assert.AreEqual( MIME_TYPE, modification.Type ); + Assert.AreEqual( LOCALPATH, modification.Url ); + Assert.AreEqual( CHANGED_BY, modification.UserName ); + Assert.AreEqual( NXN_VERSIONNUMBER, modification.Version ); + + } + + [Test] + public void MustReturnNoModificationIfNoChange() + { + Modification[] modification = parser.Parse(new StringReader( SAMPLE_NO_CHANGES ), DateTime.Now, DateTime.Now); + Assert.AreEqual( null, modification ); + } + } + } *** project/UnitTests/Core/SourceControl/AlienbrainTest.cs Wed Dec 31 14:00:00 1969 --- project/UnitTests/Core/SourceControl/AlienbrainTest.cs Tue Nov 22 19:23:56 2005 *************** *** 0 **** --- 1,421 ---- + using System; + using System.Globalization; + using Exortech.NetReflector; + using NMock; + using NUnit.Framework; + using ThoughtWorks.CruiseControl.Core; + using ThoughtWorks.CruiseControl.Core.Sourcecontrol; + using ThoughtWorks.CruiseControl.Core.Util; + + namespace ThoughtWorks.CruiseControl.UnitTests.Core.Sourcecontrol + { + [TestFixture] + public class AlienbrainTest + { + public const string EXECUTABLE = @"EXECUTABLE_DOES_NOT_EXIST\ab.exe"; + public const string INSTALLDIR = @"C:\Program Files\alienbrain"; + public const string SERVER = @"SERVER_DOES_NOT_EXIST"; + public const string DATABASE = @"DATABASE_DOES_NOT_EXIST"; + public const string USER = @"USER_DOES_NOT_EXIST"; + public const string PASSWORD = @"PASSWORD_DOES_NOT_EXIST"; + public const string PROJECT_PATH = @"ab://PATH_DOES_NOT_EXIST"; + public const string WORKDIR_PATH = @"C:\DOES_NOT_EXIST"; + public const string BRANCH_PATH = @"BRANCH_DOES_NOT_EXIST"; + public const string AUTO_GET_SOURCE = "false"; + public const string LABEL_ON_SUCCESS = "false"; + + public static readonly string XML_STUB = @"<sourceControl type=""alienbrain""> + <executable>{0}</executable> + <server>{1}</server> + <database>{2}</database> + <username>{3}</username> + <password>{4}</password> + <project>{5}</project> + <workingDirectory>{6}</workingDirectory> + <branch>{7}</branch> + <autoGetSource>{8}</autoGetSource> + <labelOnSuccess>{9}</labelOnSuccess> + </sourceControl>"; + + public static readonly string XML_STUB_MINIMAL = @"<sourceControl type=""alienbrain""> + <server>{0}</server> + <database>{1}</database> + <username>{2}</username> + <password>{3}</password> + <project>{4}</project> + </sourceControl>"; + + + public static readonly string ALIENBRAIN_XML = string.Format(XML_STUB, + EXECUTABLE, + SERVER, + DATABASE, + USER, + PASSWORD, + PROJECT_PATH, + WORKDIR_PATH, + BRANCH_PATH, + AUTO_GET_SOURCE, + LABEL_ON_SUCCESS); + + public static readonly string ALIENBRAIN_XML_MINIMAL = string.Format(XML_STUB_MINIMAL, + SERVER, + DATABASE, + USER, + PASSWORD, + PROJECT_PATH); + + private Alienbrain alienbrain; + + [SetUp] + protected void Setup() + { + alienbrain = new Alienbrain(); + NetReflector.Read(ALIENBRAIN_XML, alienbrain); + } + + + // Process Creations + + [Test] + public void CanCreateModificationProcess() + { + const string project = "ab://test_path"; + DateTime to = DateTime.Today; + DateTime from = to.AddDays(-1); + + alienbrain.Project = project; + + ProcessInfo info = alienbrain.createModificationProcess(Alienbrain.MODIFICATIONS_COMMAND_TEMPLATE, from, to); + Assert.AreEqual( EXECUTABLE + " " + String.Format(Alienbrain.MODIFICATIONS_COMMAND_TEMPLATE, + project, + SERVER, + DATABASE, + USER, + PASSWORD, + from.ToFileTime(), to.ToFileTime() ), + info.FileName + " " + info.Arguments); + } + + [Test] + public void CanCreateLabelProcess() + { + + const string name = "WORKING LABEL"; + const string project = "ab://test_path"; + + alienbrain.Project = project; + + ProcessInfo info = alienbrain.createLabelProcess(Alienbrain.LABEL_COMMAND_TEMPLATE, IntegrationResultMother.CreateSuccessful(name)); + Assert.AreEqual(EXECUTABLE + " " + String.Format(Alienbrain.LABEL_COMMAND_TEMPLATE, + project, + SERVER, + DATABASE, + USER, + PASSWORD, + name), + info.FileName + " " + info.Arguments); + } + + [Test] + public void CanCreateGetProcess() + { + const string name = "ab://existing project"; + alienbrain.Project = name; + + ProcessInfo info = alienbrain.createGetProcess(Alienbrain.GET_COMMAND_TEMPLATE); + Assert.AreEqual(EXECUTABLE + " " + String.Format(Alienbrain.GET_COMMAND_TEMPLATE, + name, + SERVER, + DATABASE, + USER, + PASSWORD, + WORKDIR_PATH), + info.FileName + " " + info.Arguments); + } + + [Test] + public void CanCreateBranchProcess() + { + const string name = "branch sample"; + alienbrain.Branch = name; + + ProcessInfo info = alienbrain.createBranchProcess(Alienbrain.BRANCH_COMMAND_TEMPLATE); + Assert.AreEqual(EXECUTABLE + " " + String.Format(Alienbrain.BRANCH_COMMAND_TEMPLATE, + name, + SERVER, + DATABASE, + USER, + PASSWORD), + info.FileName + " " + info.Arguments); + } + + + + // XML Tests + [Test] + public void ShouldPopulateCorrectlyFromXml() + { + NetReflector.Read(ALIENBRAIN_XML, alienbrain); + Assert.AreEqual(EXECUTABLE, alienbrain.Executable); + Assert.AreEqual(SERVER, alienbrain.Server); + Assert.AreEqual(DATABASE, alienbrain.Database); + Assert.AreEqual(USER, alienbrain.Username); + Assert.AreEqual(PASSWORD, alienbrain.Password); + Assert.AreEqual(PROJECT_PATH, alienbrain.Project); + Assert.AreEqual(WORKDIR_PATH, alienbrain.WorkingDirectory); + Assert.AreEqual(BRANCH_PATH, alienbrain.Branch); + Assert.AreEqual(Convert.ToBoolean(AUTO_GET_SOURCE), alienbrain.AutoGetSource); + Assert.AreEqual(Convert.ToBoolean(LABEL_ON_SUCCESS), alienbrain.LabelOnSuccess); + } + + + [Test] + public void ShouldPopulateCorrectlyFromMinimalXml() + { + Alienbrain alienbrain = new Alienbrain(); + NetReflector.Read(ALIENBRAIN_XML_MINIMAL, alienbrain); + + // Get Default Executable from registry + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + registry.ExpectAndReturn("GetExpectedLocalMachineSubKeyValue", INSTALLDIR, Alienbrain.AB_REGISTRY_PATH, Alienbrain.AB_REGISTRY_KEY); + alienbrain.Executable = string.Empty; + Assert.AreEqual(INSTALLDIR + "\\" + Alienbrain.AB_COMMMAND_PATH + "\\" + Alienbrain.AB_EXE, alienbrain.Executable); + + Assert.AreEqual(SERVER, alienbrain.Server); + Assert.AreEqual(DATABASE, alienbrain.Database); + Assert.AreEqual(USER, alienbrain.Username); + Assert.AreEqual(PASSWORD, alienbrain.Password); + Assert.AreEqual(PROJECT_PATH, alienbrain.Project); + Assert.AreEqual(string.Empty, alienbrain.WorkingDirectory); + Assert.AreEqual(string.Empty, alienbrain.Branch); + Assert.AreEqual(Convert.ToBoolean(false), alienbrain.AutoGetSource); + Assert.AreEqual(Convert.ToBoolean(false), alienbrain.LabelOnSuccess); + } + + [Test, ExpectedException(typeof (NetReflectorException))] + public void CanCatchInvalidGetSourceFlagConfiguration() + { + Alienbrain alienbrain = new Alienbrain(); + const string invalidXml = "<sourcecontrol type=\"alienbrain\"><autoGetSource>NOT_A_BOOLEAN</autoGetSource></sourcecontrol>"; + NetReflector.Read(invalidXml, alienbrain); + } + + [Test, ExpectedException(typeof (NetReflectorException))] + public void CanCatchInvalidLabelOnSuccessConfiguration() + { + Alienbrain alienbrain = new Alienbrain(); + const string invalidXml = "<sourcecontrol type=\"alienbrain\"><labelOnSuccess>NOT_A_BOOLEAN</labelOnSuccess></sourcecontrol>"; + NetReflector.Read(invalidXml, alienbrain); + } + + + + // Actions tests + public void CanExecuteHasChanges() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.Project = PROJECT_PATH; + alienbrain.Executable = EXECUTABLE; + alienbrain.Server = SERVER; + alienbrain.Database = DATABASE; + alienbrain.Username = USER; + alienbrain.Password = PASSWORD; + alienbrain.WorkingDirectory = WORKDIR_PATH; + + ProcessInfo expectedProcessRequest = new ProcessInfo(EXECUTABLE, string.Format(Alienbrain.GET_COMMAND_TEMPLATE, + PROJECT_PATH, + SERVER, + DATABASE, + USER, + PASSWORD, + WORKDIR_PATH)); + + expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis; + + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + alienbrain.HasChanges(expectedProcessRequest); + executor.Verify(); + } + + + /* + [Test] + public void CanGetModifications() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + DateTime todatetime = DateTime.Today; + DateTime fromdatetime = todatetime.AddDays(-1); + + IIntegrationResult from = IntegrationResultMother.CreateSuccessful(fromdatetime); + IIntegrationResult to = IntegrationResultMother.CreateSuccessful(todatetime); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.Project = PROJECT_PATH; + alienbrain.Executable = EXECUTABLE; + alienbrain.Server = SERVER; + alienbrain.Database = DATABASE; + alienbrain.Username = USER; + alienbrain.Password = PASSWORD; + alienbrain.Branch = string.Empty; + + ProcessInfo expectedProcessRequest = new ProcessInfo( EXECUTABLE, string.Format(Alienbrain.MODIFICATIONS_COMMAND_TEMPLATE, + PROJECT_PATH, + SERVER, + DATABASE, + USER, + PASSWORD, + from.StartTime.ToFileTime(), + to.StartTime.ToFileTime() ) ); + + expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis; + + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + alienbrain.GetModifications(from,to); + executor.Verify(); + } + */ + + [Test] + public void ShouldLabelSourceControlifLabelOnSuccessisTrueAndResultisSuccess() + { + string name = "VALID_LABEL_NAME"; + + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.Project = PROJECT_PATH; + alienbrain.Executable = EXECUTABLE; + alienbrain.Server = SERVER; + alienbrain.Database = DATABASE; + alienbrain.Username = USER; + alienbrain.Password = PASSWORD; + alienbrain.LabelOnSuccess = true; + + ProcessInfo expectedProcessRequest = new ProcessInfo(EXECUTABLE, string.Format(Alienbrain.LABEL_COMMAND_TEMPLATE, + PROJECT_PATH, + SERVER, + DATABASE, + USER, + PASSWORD, + name)); + + expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis; + + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + alienbrain.LabelSourceControl(IntegrationResultMother.CreateSuccessful(name)); + executor.Verify(); + } + + [Test] + public void ShouldNotLabelSourceControlifLabelOnSuccessisTrueAndResultisFailed() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.LabelOnSuccess = true; + + executor.ExpectNoCall("Execute", typeof(ProcessInfo)); + alienbrain.LabelSourceControl(IntegrationResultMother.CreateFailed()); + executor.Verify(); + } + + [Test] + public void ShouldNotLabelSourceControlifLabelOnSuccessisFalseAndResultisSuccess() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.LabelOnSuccess = false; + + executor.ExpectNoCall("Execute", typeof(ProcessInfo)); + alienbrain.LabelSourceControl(IntegrationResultMother.CreateSuccessful()); + executor.Verify(); + } + + + [Test] + public void ShouldGetSourceIfAutoGetSourceTrue() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.Project = PROJECT_PATH; + alienbrain.Executable = EXECUTABLE; + alienbrain.Server = SERVER; + alienbrain.Database = DATABASE; + alienbrain.Username = USER; + alienbrain.Password = PASSWORD; + alienbrain.WorkingDirectory = WORKDIR_PATH; + alienbrain.AutoGetSource = true; + + ProcessInfo expectedProcessRequest = new ProcessInfo(EXECUTABLE, string.Format(Alienbrain.GET_COMMAND_TEMPLATE, + PROJECT_PATH, + SERVER, + DATABASE, + USER, + PASSWORD, + WORKDIR_PATH)); + + expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis; + + executor.ExpectAndReturn("Execute", new ProcessResult("foo", null, 0, false), expectedProcessRequest); + alienbrain.GetSource(new IntegrationResult()); + executor.Verify(); + } + + [Test] + public void ShouldNotGetSourceIfAutoGetSourceFalse() + { + DynamicMock executor = new DynamicMock(typeof(ProcessExecutor)); + DynamicMock parser = new DynamicMock(typeof(IHistoryParser)); + DynamicMock registry = new DynamicMock(typeof(IRegistry)); + + Alienbrain alienbrain = new Alienbrain((IHistoryParser) parser.MockInstance,(ProcessExecutor) executor.MockInstance, (IRegistry) registry.MockInstance); + + alienbrain.Project = PROJECT_PATH; + alienbrain.Executable = EXECUTABLE; + alienbrain.Server = SERVER; + alienbrain.Database = DATABASE; + alienbrain.Username = USER; + alienbrain.Password = PASSWORD; + alienbrain.WorkingDirectory = WORKDIR_PATH; + alienbrain.AutoGetSource = false; + + ProcessInfo expectedProcessRequest = new ProcessInfo(EXECUTABLE, string.Format(Alienbrain.GET_COMMAND_TEMPLATE, + PROJECT_PATH, + SERVER, + DATABASE, + USER, + PASSWORD, + WORKDIR_PATH)); + + expectedProcessRequest.TimeOut = Timeout.DefaultTimeout.Millis; + + executor.ExpectNoCall("Execute", typeof(ProcessInfo)); + alienbrain.GetSource(new IntegrationResult()); + executor.Verify(); + } + } + } \ No newline at end of file *** project/core/core.csproj 16 Nov 2005 19:55:25 -0000 1.170 --- project/core/core.csproj 21 Nov 2005 22:59:42 -0000 *************** *** 629,634 **** --- 629,644 ---- BuildAction = "Compile" /> <File + RelPath = "sourcecontrol\Alienbrain.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "sourcecontrol\AlienbrainHistoryParser.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "sourcecontrol\ClearCase.cs" SubType = "Code" BuildAction = "Compile" *** project/UnitTests/UnitTests.csproj 18 Nov 2005 06:10:16 -0000 1.164 --- project/UnitTests/UnitTests.csproj 22 Nov 2005 23:36:45 -0000 *************** *** 686,691 **** --- 686,701 ---- BuildAction = "Compile" /> <File + RelPath = "Core\SourceControl\AlienbrainHistoryParserTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Core\SourceControl\AlienbrainTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Core\SourceControl\ClearCaseHistoryParserTest.cs" SubType = "Code" BuildAction = "Compile" |
|
From: <ki...@mv...> - 2005-11-23 19:19:57
|
Hi Daniel, > One of my colleagues pointed out that I could use the > following NANT Target to insepect the source rather than the > .DLL; is this still valid? As I understand it, there are two different products called NCover. One that does its spelunking in run-time [1] and one that instruments the source code prior to compilation [2]. Yours appears to be [1], since the other is still at a pre-1.0 version, so I wouldn't attempt to use it for source instrumentation. Can't help with the real issue, sorry. - Kim [1] http://www.ncover.org/ [2] http://ncover.sourceforge.net/ |