-
Notifications
You must be signed in to change notification settings - Fork 260
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 test in github actions: Validations cache not found #623
Comments
I have manged to solve these issues by uploading artifacts directory and validations.json. But I'm not sure if I have to upload the json files every time I refactor upgradeable contracts with some test files. If I understood correctly how testing upgradeable contract in github actions works, I have to. Do I? |
You definitely shouldn't need to add those files to your repository! I don't know why this is happening to you. Can you create a minimal repo that reproduces the issue? |
I will try to reproduce the issue and comment again. That's the point where I felt a bit strange cause I thought like I read Openzeppelin docs saying that you don't have to upload build-info and such directory to git, unlike .openzeppelin directory is recommended to upload to git. One more question, Maybe is it because I was using mocha test in CI instead of hardhat test command? I know hardhat already uses mocha but I did that to exploit more flag options, for example slow like below. The command I was using is, "test:unit": "mocha -g \"unit\" --slow 2000 --reporter list", From Hardhat ver2.9, it can be replaced with, "test:unit": "pnpm exec hardhat test --grep \"unit\"" Is there difference between executing test for upgradeable contracts by mocha and by hardhat? |
Yes, this is the problem. |
I'll leave a fixed script command below for others. I solved issue change the script from "test:unit": "mocha -g \"unit\" --slow 2000 --reporter list", to "ci:unit": "pnpm exec hardhat test --grep \"unit\"",
"ci:integ": "pnpm exec hardhat test --grep \"integ\"",
"ci:tests": "pnpm ci:unit & pnpm ci:integ", Recommend to split scripts to 1) development (mocha test command with fluent flag options + nodemon ) 2) ci (hardhat test command for generating artifacts and stuff you need). Check the scripts here: https://github.com/asunlabs/pawcon-monorepo/blob/develop/apps/blockchain/package.json |
problem
I was working on my personal project using openzeppelin/contracts-upgradeable.
Github actions requires below things for testing upgradeable ERC20(UUPS)
screenshot
dependency
The text was updated successfully, but these errors were encountered: