-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(test-repository-postgresql): run repository tests for postgresql #3853
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
Conversation
7e368a3 to
2f033b5
Compare
bajtos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, assuming that tests are passing :)
acceptance/repository-postgresql/src/__tests__/postgresql.datasource.ts
Outdated
Show resolved
Hide resolved
e54155b to
19dfd28
Compare
acceptance/repository-postgresql/src/__tests__/postgresql.datasource.ts
Outdated
Show resolved
Hide resolved
2e313e5 to
479c57d
Compare
|
Re the coverage drop: the transactions test suite isn't run by the memory database, but it's run by |
ce4337c to
ec2028b
Compare
66b6bc5 to
90ffb19
Compare
bajtos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are steps I did to verify these changes:
git checkout postgresql-tests
npm i
npm run build
cd acceptance/repository-postgresql
source setup.sh
npm t
One of the tests failed:
1) PostgreSQL + DefaultTransactionalRepository
CRUD Repository operations
transactions
create-retrieve with transactions
should not use transaction with another repository:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/bajtos/src/loopback/next/acceptance/repository-postgresql/dist/__tests__/postgresql-default-repository.acceptance.js)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)
Could you PTAL?
|
BTW I find it weird that the test is failing with a timeout, I would expect it to throw an error saying that the configured database does not exist. This is probably a bug in our PostgreSQL connector, therefore out of scope of this pull request, but possibly worth fixing or at least opening a GH issue for. |
@nabdelgadir ^ please respond to this comment |
|
Regarding
Do you have a proposed fix (new set of tests) to bring the coverage back up to an appropriate level? Right now, the CI is complaining |
90ffb19 to
c9e050e
Compare
@bajtos I tried creating an app to reproduce this error, and it actually does throw a descriptive error (e.g. |
@emonddr Not really sure how to bring it back up because as I said the coverage only accounts for tests run by the memory database and the memory database doesn't support transactions. So the coverage for the file it's complaining about can't be brought back up. But do you have something in mind? |
42c548d to
4f0ef07
Compare
| # Running Code Linter -- Requires @loopback/build so it's bootstrapped | ||
| script: | ||
| - lerna bootstrap --scope @loopback/build --include-filtered-dependencies | ||
| - lerna bootstrap --scope @loopback/build --include-dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4f0ef07 to
ab40134
Compare
|
@slnode test please |
ab40134 to
eced00b
Compare
eced00b to
48d6e0b
Compare
|
@nabdelgadir , did you run the tests locally and all tests passed? Referring to @bajtos comment in #3853 (review) . |
Yes, they work locally. |
48d6e0b to
b5a31e4
Compare


Resolves #3436.
Added
acceptance/repository-postgresqlpackage in order forrepository-teststo be run for PostgreSQL.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈