Add a "make check" rule to prepare and run all tests #230

Closed
strk opened this Issue Dec 11, 2012 · 11 comments

Projects

None yet

5 participants

@strk
strk commented Dec 11, 2012

Running the testsuite must be as easy as possible.
Ideally a make check rule to run all tests, including preparation.
Env variables can be used to specify the database access params and the preparation script must ensure to survive if the database already exist.

If preparation is impossible a message could be printed warning and suggesting how to run more tests

@brianc
Owner
brianc commented Dec 11, 2012

I agree with you. Test suite a bit too hard to run. What I'd actually like to do is remove the dependency on Make entirely. It'd be nice to be able to run the tests on windows.

@strk
strk commented Dec 12, 2012

I've no problem with dropping the dependency but I'd love to still have a Makefile
around. It's a matter of user friendly-ness

@brianc
Owner
brianc commented Dec 12, 2012

I definitely want it to be user friendly as possible. More so than now even. I just was thinking Makefile is not really as user friendly as say some Grunt tasks only because Make doesn't exist on windows and isn't even installed with mysysgit. I tried out grunt on a personal project recently and thought the results were pretty good. What do you think about grunt for doing testing, test environment setup, and even to spit instructions out to the console?

@strk
strk commented Dec 12, 2012

On Wed, Dec 12, 2012 at 11:09:05AM -0800, Brian C wrote:

I definitely want it to be user friendly as possible. More so than now even. I just was thinking Makefile is not really as user friendly as say some Grunt tasks only because Make doesn't exist on windows and isn't even installed with mysysgit. I tried out grunt on a personal project recently and thought the results were pretty good. What do you think about grunt for doing testing, test environment setup, and even to spit instructions out to the console?

Friendship is bidirectional.
Why being friendly with software you can't share ?

That said, I've no experience with Grunt, but as long
as there's a Makefile wrapper I'm happy with anything underneath
that is an apt-get install away.

--strk;

@neonstalwart

maybe npm test could be the entry point for running the test suite.

@strk
strk commented Dec 13, 2012

Yes, it is good if npm test is one entry point.
I'm often using a "make check" rule calling "npm test" :)

@strk
strk commented Jan 16, 2013

Does node-postgresql have the ability to create databases ?

@nicholasf

We have that set up in a grunt plugin, if that will help you: https://github.com/moneytribeaustralia/grunt-pg

Just about to start using it at work. Fresh meat!

Cheers,
N.

On 16/01/2013, at 8:27 PM, strk wrote:

Does node-postgresql have the ability to create databases ?


Reply to this email directly or view it on GitHub.

@booo
Collaborator
booo commented Jan 19, 2013

@strk What do you mean by "create databases"? You could of course use the CREATE DATABASE query:
http://www.postgresql.org/docs/9.0/static/sql-createdatabase.html

I think we should add a make check target to the make file. Make check, npm test and make test should all execute the same command.

We should start caring about the windows guy/devs if they start to contribute to free software ;)

@brianc brianc closed this Jan 21, 2013
@strk
strk commented Jan 21, 2013

Why closed ? There still isn't a "make check" rule :)
@booo yeah, I guess we can use CREATE DATABASE sql query.
The idea is that "make check" creates a temporary db, runs all tests and then drops it.
We now have a "prepare-test-db" rule assuming the db is already available, so we need a couple more rules one to create the db and one to drop it afterwards.. It usually gets too complex for a Makefile and I end up using a shell script (invoked by Makefile..)

@brianc
Owner
brianc commented Jan 21, 2013

whoops - I thought the prepare-test-db rule and the make check rule where the same.

@brianc brianc reopened this Jan 21, 2013
@brianc brianc closed this Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment