Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Internal improvement: Move db integration test to truffle package #5640

Merged
merged 9 commits into from
Oct 31, 2022

Conversation

eggplantzzz
Copy link
Contributor

@eggplantzzz eggplantzzz commented Oct 24, 2022

In order to remove a cyclic dependency in db (@truffle/db --> @truffle/migrate --> @truffle/db-loader --> @truffle/db) this PR moves and rewrites a db integration test and finds a new home for it in truffle.

This should retire #5600

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, an improved db test! Looks good to me!

packages/db/.ignore Outdated Show resolved Hide resolved
Copy link
Contributor

@dongmingh dongmingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran yarn test on packages/truffle and observed that the db test is executed successfully

    truffle db
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
      ✔ creates a project
      ✔ retrieves contract instances by project (82ms)
      ✔ retrieves saved compilations
      ✔ creates contract records
      ✔ loads contract sources
      ✔ loads bytecodes

However, there are dependency warning message:

$ yarn test
yarn run v1.22.11
warning package.json: "optionalDependencies" has dependency "@truffle/db" with range "^2.0.3" that collides with a dependency in "devDependencies" of the same name with version "^2.0.2"
$ ./scripts/test.sh
warning package.json: "optionalDependencies" has dependency "@truffle/db" with range "^2.0.3" that collides with a dependency in "devDependencies" of the same name with version "^2.0.2"
$ /Users/dongminghwang/work/trufflesuite/truffle/node_modules/.bin/semver -r '>=12' v16.15.0
16.15.0
warning package.json: "optionalDependencies" has dependency "@truffle/db" with range "^2.0.3" that collides with a dependency in "devDependencies" of the same name with version "^2.0.2"
$ yarn build:cli
warning package.json: "optionalDependencies" has dependency "@truffle/db" with range "^2.0.3" that collides with a dependency in "devDependencies" of the same name with version "^2.0.2"

@haltman-at
Copy link
Contributor

Oh, looks like versions in package.json will have to be updated before merging.

Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm going to go ahead and hit request changes to make sure this doesn't get merged without the versions being fixed.

packages/db/package.json Outdated Show resolved Hide resolved
packages/truffle/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@dongmingh dongmingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-test shows that the dependency issue is fixed. Thanks.
I like the idea of moving db integration test to truffle package.
The changes are good.

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass, versions synced, looks good. I like it.

Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@eggplantzzz eggplantzzz merged commit ea55dba into develop Oct 31, 2022
@eggplantzzz eggplantzzz deleted the move-test branch October 31, 2022 20:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants