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

test: poc test solution #116

Merged
merged 51 commits into from
Feb 8, 2024
Merged

test: poc test solution #116

merged 51 commits into from
Feb 8, 2024

Conversation

pcheremu
Copy link

What πŸ’»

Proof of concept (POC) test solution for CLI

Why βœ‹

To verify CLI output

Evidence πŸ“·

n/a

Notes πŸ“

n/a

@pcheremu pcheremu self-assigned this Jan 25, 2024
@pcheremu pcheremu added the automation autotests \ QA tests label Jan 25, 2024
@pcheremu pcheremu marked this pull request as ready for review January 29, 2024 14:52
@pcheremu pcheremu requested a review from a team as a code owner January 29, 2024 14:52
README.md Outdated Show resolved Hide resolved
test/src/entities.ts Outdated Show resolved Hide resolved
test/src/entities.ts Outdated Show resolved Hide resolved
In the meantime, you can test the code manually by running the code in [development mode](#run-in-development-mode).

### CLI tests

To run CLI tests for zksync-cli do the following:

Choose a reason for hiding this comment

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

I haven't found test-related packages in package.json.

Probably, it's better to use either a separate package.json in the test folder with the necessary packages for the test run (or add some pre-test script to the main package.json).

I think having the necessary modules described in the package.json file is a good approach. Accordingly to this approach, we don't need to install modules in the hand mode for the local run (and before reading the Readme.MD file just for running tests). So the test run would be simpler locally.

Copy link
Author

@pcheremu pcheremu Jan 30, 2024

Choose a reason for hiding this comment

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

@abilevych are you about jest /shelljs and similar test related packages in a separate package.json? If yes - I had such separate file in this test folder in the very beginning (796831a), @vasyl-ivanchuk asked me to merge them with main package.json and remove them from the test folder.

Copy link
Author

Choose a reason for hiding this comment

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

Now installation process updated, we have to use build step instead of installing a package separately

Copy link
Author

Choose a reason for hiding this comment

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

please let me know if now everything looks good now. @JackHamer09 fyi

README.md Outdated
1. Go to [test](`./test`) folder
2. Run `npm i` and install zksync-cli `npm i zksync-cli`
3. Make sure you have [Docker](https://docs.docker.com/engine/install/) on your system.
4. Make sure you have `.env` file with your wallet private key in `./test/src/` dir. Key is `E2E_TESTNET_PK`. It may looks like `E2E_TESTNET_PK=012345...abcdef`

Choose a reason for hiding this comment

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

I'd suggest creating that file as the .env.local or just .env. And it needs to contain a proper fields with stubs.

Copy link
Author

Choose a reason for hiding this comment

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

add a .env.example and updated the description

package.json Outdated
"commitlint": "commitlint --edit"
"lint": "eslint . --ext ./{src,test}/* --fix --ignore-path .gitignore --no-error-on-unmatched-pattern --max-warnings=0",
"commitlint": "commitlint --edit",
"test": "jest"

Choose a reason for hiding this comment

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

I'm suggesting to add here the --verbose flag

Copy link
Author

Choose a reason for hiding this comment

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

added

});

//id1874
describe("User can call read method from deployed contract on network", () => {

Choose a reason for hiding this comment

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

image I've got a failed test locally.

Have you faced that before?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching this, I was able to reproduce, on a clean environment. I have specified path to .env now it works for me. Could you please try again?
Also which zksync-cli --version do you see?, it should be 1.2.0

Choose a reason for hiding this comment

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

There is the 0.11.0 version appears.

Considering that I've been carefully going through the FAQ steps, I shouldn't face that.

Can you align the pre-requisite steps to avoid that with installing/using the working CLI version by default?

@pcheremu pcheremu merged commit cc39561 into implement-tests Feb 8, 2024
8 checks passed
@pcheremu pcheremu deleted the QA-615-test-solution branch February 8, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation autotests \ QA tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants