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

Add pytest workflow #25

Merged
merged 10 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
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
40 changes: 40 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##
## Copyright 2023 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: pdr-backend tests

on:
pull_request:
push:
branches: [main]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup repository
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: Test with pytest
id: pytest
env:
ADDRESS_FILE: "${{env.HOME}}/.ocean/ocean-contracts/artifacts/address.json"
RPC_URL: "http://127.0.0.1:8545"
SUBGRAPH_URL: "http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph"
PRIVATE_KEY: "0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209"
run: |
coverage run --omit="*test*" -m pytest
coverage report
2 changes: 1 addition & 1 deletion pdr_backend/dfbuyer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pdr_backend.dfbuyer.utils.subgraph import get_consume_so_far
from pdr_backend.utils.subgraph import get_all_interesting_prediction_contracts
from pdr_backend.utils.contract import PredictorContract, Web3Config
from pdr_backend.utils.contract import PredictoorContract, Web3Config
from pdr_backend.utils import env
rpc_url = env.get_rpc_url_or_exit()
subgraph_url = env.get_subgraph_or_exit()
Expand Down
2 changes: 1 addition & 1 deletion pdr_backend/predictoor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pdr_backend.predictoor.predict import predict_function
from pdr_backend.utils.subgraph import get_all_interesting_prediction_contracts
from pdr_backend.utils.contract import PredictorContract, Web3Config
from pdr_backend.utils.contract import PredictoorContract, Web3Config
from pdr_backend.utils import env


Expand Down
2 changes: 1 addition & 1 deletion pdr_backend/trueval/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pdr_backend.trueval.trueval import get_true_val
from pdr_backend.utils.subgraph import get_all_interesting_prediction_contracts
from pdr_backend.utils.contract import PredictorContract, Web3Config
from pdr_backend.utils.contract import PredictoorContract, Web3Config
from pdr_backend.utils import env


Expand Down
Loading