kputnam / piggly

PL/pgSQL stored procedure code coverage tool
Other
69 stars 14 forks source link

Improve automated testing #50

Open kputnam opened 3 years ago

kputnam commented 3 years ago

Since I no longer write PL/pgSQL during the course of my work, it takes me some time to setup a test environment when making changes to this project. Now that Docker is widely used, it makes sense to use it for this purpose. Now that GitHub can execute Docker containers, we can write automated integration tests that talk to an actual PostgreSQL server.

If someone is interested in contributing to this, I'll happily merge a PR. Otherwise, this will be worked on in my spare time.

vzdm commented 6 months ago

I hope to pull piggly into my development environment which is available here.

In this project I am setting up a postgres database which replicates the mssql adventure works database so that as part of feature development the unit tests are automatically executed and coverage reports are generated. I will be adding the functions early in Feb.

My goal is to have piggly installed on the postgres docker image to allow for code coverage reports to be generated. I would be happy to include some test cases to prove out various changes/updates in piggly. You may be able to re-use something from here.

kputnam commented 6 months ago

Hi @vzdm, thanks for telling me about your project. Let me know if you need anything, and I'm looking forward to seeing it working!

vzdm commented 5 months ago

I've finally managed to get the time to integrate piggly into the project. You can see this in action by running the postgres example, I've updated the readme with details.

For now I have only a single function just to prove out the process and I will add more as time goes on. Not sure why the report is stating 0 coverage but I'll take a look at that later next week. From your perspective this is one way to automatically spin up a postgres instance and test any changes made in piggly.

There is a lot more in my repo you probably don't care about but it's easy to rip out if you decide on re-using anything.