srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
242 stars 29 forks source link

development database is not configured #40

Closed professor closed 13 years ago

professor commented 13 years ago

Goldberg is working nicely on my development machine. I'm now installing it on my CI machine. (I stole my database.yml file from a cruise control project.) It only had the test database environment defined. It appears that Goldberg also wants the development database configured. I'm guessing we need a RAILS_ENV="test" on one of the rake commands to fix this.

srushti commented 13 years ago

Depending on how you run it you'll have to do RAILS_ENV="development" (which is implicit) or RAILS_ENV=production. "test" should only be used to run goldberg's own tests.

aakashd commented 13 years ago

@srushti, I did not get what you mean by goldberg's own tests.

Although, I won't be comfortable hardcoding RAILS_ENV=test, because if someone wants to override it or change it, they won't be able to do so because of this hardcoding. We can probably mention in the documentation that, people can mention RAILS_ENV=test in the custom command if this is intended behavior.

srushti commented 13 years ago

@aakashd Maybe I misunderstood the original problem, but it looked like he only had goldberg's test database configured & defined. I was mentioning that you don't want to run goldberg on the test database, since that is to be used to run goldberg's own specs, and that while running the app you want to use one of the other two configurations (after having defined it in the database.yml, of course).

professor commented 13 years ago

I expect goldberg to act as a continuous integration platform. As such, I expect it to run my tests and only my tests against my code. If it is running my tests (ie my rspecs), then I expect goldberg to execute them against my test database. I don't know why I should have created a development database for goldberg to function.

I believe the original intent of goldberg was to run on a local development machine. If this the case, it explains why you haven't seen this error before. I'd like to run goldberg on a standalone continuous integration machine. It's my plan to have 20 projects being tested on this machine. That's why I'd like to just create the needed 20 test databases for those projects, (not the 20 test databases plus the unnecessary 20 development databases).

If this isn't making sense, I'd be happy to setup a skype call.

To review, I expect RAILS_ENV=test to be the default behavior

srushti commented 13 years ago

The situation you describe makes sense, but I must be missing something, because I'm not sure what exactly you want. Possibly, @aakashd understood it better. I've replied directly to the email address from your commits with my skype id. Let me know what a good time is to have that call.

professor commented 13 years ago

Thanks for the great skype call. I'll ask around here to see if I"m the only person who sets up their CI environment with just test databases or if it is standard practice to setup a test and development database. (If its the later, I'll conform to the norm.)

srushti commented 13 years ago

I'm closing this since we now have the ability to do what you want in a more generic way. You can add environment_variables through goldberg_config, which in your case would be "RAILS_ENV=test". It looks like cc.rb does do this by default, but I'm still not sure we want to be prescribing this.

professor commented 13 years ago

I've asked around locally here in Silicon Valley, and quite a few people think that a build machine should NOT have a development database.

Todd

On Sun, May 1, 2011 at 10:56 PM, srushti < reply@reply.github.com>wrote:

I'm closing this since we now have the ability to do what you want in a more generic way. You can add environment_variables through goldberg_config, which in your case would be "RAILS_ENV=test". It looks like cc.rb does do this by default, but I'm still not sure we want to be prescribing this.

Reply to this email directly or view it on GitHub: https://github.com/c42/goldberg/issues/40#comment_1086735

srushti commented 13 years ago

Yeah, fair enough. Just wondering if a ci server should enforce it, or expect the users to know what they're doing and do it themselves.

professor commented 13 years ago

I guess the question is what user base do you want to attract. Do you only want to cater to build engineers, or do you want to also cater to software developers? The first group will be able to figure it out. The second group may not have much time to deal with assumptions made by goldberg. If goldberg is going to make assumptions, that's fine, but they should be more clearly articulated in the README file.