This repository contains compatibility tests for neon-env from different sources which runs in ci pipeline and check how neon-evm compatible with ethereum.
This project uses ALlure for test reporting.
Reports available at: http://docs.neon-labs.org/neon-compatibility/
- Install node.js, allure (see the instruction below)
- Install neon-compatibility dependencies
- Update openzeppelin-contracts submodule
git submodule update --init --recursive
- Install openzeppelin dependencies
npm i
cd openzeppelin-contracts
npm i
- To work with the network of your interest copy or link the appropriate .env.* file into .env in the root of the solution
File | Description |
---|---|
.env.devnet | Devnet |
.env.testnet | Testnet |
.env.internal.testnet | Test stand |
.env.local | Local run in Docker |
# in the neon-compatibility folder
rm .env
ln -s ./.env.local ./.env
- Run content of the .github/actions/openzeppelin-preparation, namely (assuming you are in the neon-compatibility folder):
# in the neon-compatibility folder
rm -rf openzeppelin-contracts
git submodule update --init --recursive
cd openzeppelin-contracts
mkdir allure-results
cp ../categories.json allure-results
cp ../hardhat.config.js ./
cp ../get_private_keys.js ./
Now you have:
- the ./openzeppelin-contracts folder with some files and folders
- the ./openzeppelin-contracts/hardhat.config.js file has the same content as ./hardhat.config.js with changes for neon testing
- there is the ./openzeppelin-contracts/allure-results folder and categories.json inside it
- Run all the tests
# in the neon-compatibility/openzeppelin-contracts folder
env PRIVATE_KEYS=$(./get_private_keys.js) npx hardhat test
- Or run a subfolder with tests, for example
# in the neon-compatibility/openzeppelin-contracts folder
find "$(pwd)/test/finance" | grep test.js | echo $_ | env PRIVATE_KEYS=$(./get_private_keys.js) ../node_modules/.bin/hardhat test $_
- Or run a single test
# in the neon-compatibility/openzeppelin-contracts folder
env PRIVATE_KEYS=$(./get_private_keys.js) ../node_modules/.bin/hardhat test ./test/access/AccessControl.test.js
- Having finished, tests leave after themselves folder with test results ./openzeppelin-contracts/allure-results and you are ready to run allure and get the report
# in the neon-compatibility/openzeppelin-contracts folder
allure serve
You can if you with install hardhat globally by issuing the following command:
# in any folder
npm i -g hardhat
This instruction suggest using package managers heavily, you can obtain brew here: https://brew.sh/index or use any alternative solution like SDKMAN, native package managers, etc Detailed instruction for Linux is here: https://docs.brew.sh/linux
brew install [email protected]
brew install pipenv
brew install node
# npm is already here, otherwise brew install npm
brew install allure
# assuming that there already is Python 3.8.10,
# otherwise install it by issuing brew install [email protected]
# or any alternate package manager
# pip
# https://pip.pypa.io/en/stable/installation/
sudo apt install python3-pip
sudo -H pip3 install --upgrade pip
# pipenv
# https://pipenv.pypa.io/en/latest/
# https://docs.pipenv.org/install/
sudo apt install pipenv
pip install pipenv
# Node.js, npm
# Do not use standard Linux package manager for installing Node.js
# prefer using brew or nvm
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
brew install node
brew install npm
# Allure
# brew install gcc
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
cd neon-compatibility
npm i
npm audit fix --force
cd neon-compatibility
pipenv --python 3.8
pipenv sync
cd neon-compatibility
pipenv shell
pytest -rP --alluredir=allure-results
allure serve
Workflow | Push | Manual | Schedule |
---|---|---|---|
Consecutive | - | + | 20:00 UTC |
Parallel | - | + | - |