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

Fix #548: Improve tests speed #558

Merged
merged 10 commits into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 40 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ jobs:
repository: "oceanprotocol/barge"
path: "barge"
ref: 9cc3a9342a47857a0495309e787462d6c60979e6

- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
run: |
echo "Login to Docker Hub";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
run: |
bash -x start_ocean.sh --no-aquarius --no-elasticsearch --no-provider --no-dashboard --with-thegraph > start_ocean.log &
for i in $(seq 1 108); do
sleep 5
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
done
ls -la "$HOME/.ocean/ocean-contracts/artifacts/"
bash -x start_ocean.sh --no-aquarius --no-elasticsearch --no-provider --no-dashboard --with-thegraph > start_ocean.log &
env:
CONTRACTS_VERSION: v1.1.3
SUBGRAPH_VERSION: v3.0.7
Expand All @@ -50,21 +51,48 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Create Brownie paths
run: |
mkdir /home/runner/.solcx
mkdir /home/runner/.vvm
mkdir -p /home/runner/.brownie/packages
- name: Restore Brownie compilers
id: restore-brownie-compilers
uses: actions/cache/restore@v3
with:
path: |
/home/runner/.solcx
/home/runner/.vvm
/home/runner/.brownie/packages
key: ${{ runner.os }}-brownie-deps
- name: Set up Openzeppelin
run: |
brownie pm install OpenZeppelin/openzeppelin-contracts@4.2.0
brownie pm install GNSPS/solidity-bytes-utils@0.8.0

[ -d "$HOME/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.2.0" ] && echo "Using OpenZeppelin/openzeppelin-contracts@4.2.0 from cache" || brownie pm install OpenZeppelin/openzeppelin-contracts@4.2.0
[ -d "$HOME/.brownie/packages/GNSPS/solidity-bytes-utils@0.8.0" ] && echo "Using GNSPS/solidity-bytes-utils@0.8.0/ from cache" || brownie pm install GNSPS/solidity-bytes-utils@0.8.0
- name: Make dftool executable
run: chmod +x dftool

- name: Wait for contracts deployment
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break
done
- name: Test with Brownie
run: |
coverage run --omit="*test*" -m pytest util/test
coverage report
coverage xml

- name: Save Brownie compilers
id: cache-brownie-compilers
uses: actions/cache/save@v3
with:
path: |
/home/runner/.solcx
/home/runner/.vvm
/home/runner/.brownie/packages
key: ${{ runner.os }}-brownie-deps
- name: Publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
Expand Down