rap2hpoutre / pg-anonymizer

Dump anonymized PostgreSQL database with a NodeJS CLI
https://raph.site
MIT License
225 stars 31 forks source link

Updating `oclif` and adding unit tests #42

Closed jackall3n closed 1 year ago

jackall3n commented 1 year ago

Hey @rap2hpoutre,

I've upgraded oclif to the latest version, now using @oclif/core which has better type safety and error handling. In addition to this I've added in unit tests (as it was listed as an enhancement #15).

pg-anonymizer changes

Error handling with CLIError

CLIError from @oclif/errors has been introduced to improve error handling in following scenarios:

Testing

Tests have been added using @oclif/test. They run against a local database referenced in the DATABASE_URL environment variable.

I've added prisma to the project. I've set it up to create the database schema and seed the database with values to test against. I've created a .github/workflows/test.yml that runs postgres, configures the database using yarn db:setup and runs yarn test.

At the moment the tests cover:

jackall3n commented 1 year ago

Solves #15 #16 #39 #43

jackall3n commented 1 year ago

Hey @rap2hpoutre, what are your thoughts on this?

jackall3n commented 1 year ago

@rap2hpoutre I've added another --silent option as it'll help with the output to stdout (-o -)

jackall3n commented 1 year ago

@rap2hpoutre If you get a chance to review this that would be great. If I don't hear from you in the next day or so, I'll just release this to a new package

rap2hpoutre commented 1 year ago

Thank you so much for your contribution 🎉 and sorry for the super late answer. I just reviewed it, I accept all your changes, and I will release it soon! (I have to remember how to release this package though !)

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 0.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: