Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit testing without postgres dependency (mock) #579

Open
4 tasks done
avelino opened this issue Aug 11, 2021 Discussed in #562 · 2 comments
Open
4 tasks done

unit testing without postgres dependency (mock) #579

avelino opened this issue Aug 11, 2021 Discussed in #562 · 2 comments

Comments

@avelino
Copy link
Member

avelino commented Aug 11, 2021

Discussed in #562

Originally posted by avelino June 23, 2021
The postgres adapter depends on the postgreSQL (database) server to run (go test), i.e. it was developed with integration testing.

Integration testing is necessary, but it raises the barrier for new members to contribute, i.e. for a person to make any contribution he needs to learn to configure the development environment and only then contribute. I think it's great to have people immersed in the project, but this is not the reality of open source projects that people contribute in their spare time (usually without pay)

I don't think it is necessary to "remove" the integration test but put it in its place:

  1. unit test that does not depend on external services (e.g. PostgreSQL) running with go test ...., so our people were able to run the tests locally (on their machines)
  2. Integration test: run only on CI (GitHub Actions or Travis CI) on pull request - doesn't necessarily have to be written with go test

What would be the best option to write postgres adapter mock?

Ref:

@vmesel
Copy link
Member

vmesel commented Nov 10, 2022

Is this still open?

@avelino
Copy link
Member Author

avelino commented Nov 10, 2022

Is this still open?

@vmesel yep, we need to rewrite the tests with unit tests in mind, this simplifies the way to run the tests for the incoming contributors

Leave the integration test (e2e) as we do for the build process (in the pipeline, even so we need to think if it is necessary)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants