dbTalk Databases Forums  

In-memory PostgreSQL database

comp.databases.postgresql comp.databases.postgresql


Discuss In-memory PostgreSQL database in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #231  
Old   
dnoyeB
 
Posts: n/a

Default Re: In-memory PostgreSQL database - 05-26-2008 , 07:11 AM






On Mon, 19 May 2008 07:39:46 +0000, Laurenz Albe wrote:

Quote:
No, I mean "every time any source file is changed in the working tree".
There's a loop watching for filesystem events on the working tree the
developer is working in, and executing the unit test suite whenever
that happens.

That way, the developer never needs to distract themselves
distinguishing between "an edit that means I should run the unit test
suite" versus "an edit that isn't worth running the unit test suite".
The unit test suite is *always* run after an edit, and the developer
can choose when to look at the results.

Ouch.

From my experience as a coder, you save code not only when you have an
error-free or even compiling state.
This means that the tests will be all red most of the time, and after
some time, people will stop watching them at all.

By save im sure he means commit to the repository. And whoever breaks the
unit test will certainly be fixing it again. And more than likely before
any other commits. So he will receive pressure to get it done. I can't
see any pressure to ignore the failed test.

Quote:
Have you talked to your developers about that?

You could have a unit test server that has a database server
installed. Every 5 minutes it checks out the project source,
initializes the database and runs the unit tests.

This is also an excellent practice, and we follow it, but is more in
line for an "integration" cycle: check out the current source code
every time a commit is done, and attempt to build the entire project,
making a report available on completion for anyone to check when they
feel like.

It's an altogether different purpose from unit testing, though.

Can't you create a RAM disk, and point postgresql server toward that. Now
when the unit test starts you just create the ram disk, start the server,
run your default sql to setup the data, and your set. Cleanup is as
simple as stopping the server and dumping the ramdisk.

However, if speed is not an issue, I don't see why you have a problem with
just using the harddisk on a full postgresql server.

Besides, your trying to cheat anyway. You know for a proper unit test you
can't use a proper DB at all. You need to use some almost scripted
responses to SQL commands. You appear to be trying to avoid that. Once
you do, you might as well just run a full db...


CL


Reply With Quote
  #232  
Old   
dnoyeB
 
Posts: n/a

Default Re: In-memory PostgreSQL database - 05-26-2008 , 07:11 AM






On Mon, 19 May 2008 07:39:46 +0000, Laurenz Albe wrote:

Quote:
No, I mean "every time any source file is changed in the working tree".
There's a loop watching for filesystem events on the working tree the
developer is working in, and executing the unit test suite whenever
that happens.

That way, the developer never needs to distract themselves
distinguishing between "an edit that means I should run the unit test
suite" versus "an edit that isn't worth running the unit test suite".
The unit test suite is *always* run after an edit, and the developer
can choose when to look at the results.

Ouch.

From my experience as a coder, you save code not only when you have an
error-free or even compiling state.
This means that the tests will be all red most of the time, and after
some time, people will stop watching them at all.

By save im sure he means commit to the repository. And whoever breaks the
unit test will certainly be fixing it again. And more than likely before
any other commits. So he will receive pressure to get it done. I can't
see any pressure to ignore the failed test.

Quote:
Have you talked to your developers about that?

You could have a unit test server that has a database server
installed. Every 5 minutes it checks out the project source,
initializes the database and runs the unit tests.

This is also an excellent practice, and we follow it, but is more in
line for an "integration" cycle: check out the current source code
every time a commit is done, and attempt to build the entire project,
making a report available on completion for anyone to check when they
feel like.

It's an altogether different purpose from unit testing, though.

Can't you create a RAM disk, and point postgresql server toward that. Now
when the unit test starts you just create the ram disk, start the server,
run your default sql to setup the data, and your set. Cleanup is as
simple as stopping the server and dumping the ramdisk.

However, if speed is not an issue, I don't see why you have a problem with
just using the harddisk on a full postgresql server.

Besides, your trying to cheat anyway. You know for a proper unit test you
can't use a proper DB at all. You need to use some almost scripted
responses to SQL commands. You appear to be trying to avoid that. Once
you do, you might as well just run a full db...


CL


Reply With Quote
  #233  
Old   
dnoyeB
 
Posts: n/a

Default Re: In-memory PostgreSQL database - 05-26-2008 , 07:11 AM



On Mon, 19 May 2008 07:39:46 +0000, Laurenz Albe wrote:

Quote:
No, I mean "every time any source file is changed in the working tree".
There's a loop watching for filesystem events on the working tree the
developer is working in, and executing the unit test suite whenever
that happens.

That way, the developer never needs to distract themselves
distinguishing between "an edit that means I should run the unit test
suite" versus "an edit that isn't worth running the unit test suite".
The unit test suite is *always* run after an edit, and the developer
can choose when to look at the results.

Ouch.

From my experience as a coder, you save code not only when you have an
error-free or even compiling state.
This means that the tests will be all red most of the time, and after
some time, people will stop watching them at all.

By save im sure he means commit to the repository. And whoever breaks the
unit test will certainly be fixing it again. And more than likely before
any other commits. So he will receive pressure to get it done. I can't
see any pressure to ignore the failed test.

Quote:
Have you talked to your developers about that?

You could have a unit test server that has a database server
installed. Every 5 minutes it checks out the project source,
initializes the database and runs the unit tests.

This is also an excellent practice, and we follow it, but is more in
line for an "integration" cycle: check out the current source code
every time a commit is done, and attempt to build the entire project,
making a report available on completion for anyone to check when they
feel like.

It's an altogether different purpose from unit testing, though.

Can't you create a RAM disk, and point postgresql server toward that. Now
when the unit test starts you just create the ram disk, start the server,
run your default sql to setup the data, and your set. Cleanup is as
simple as stopping the server and dumping the ramdisk.

However, if speed is not an issue, I don't see why you have a problem with
just using the harddisk on a full postgresql server.

Besides, your trying to cheat anyway. You know for a proper unit test you
can't use a proper DB at all. You need to use some almost scripted
responses to SQL commands. You appear to be trying to avoid that. Once
you do, you might as well just run a full db...


CL


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.