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 GitHub Actions workflow and fix failing tests #2233

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

dhruvan2006
Copy link
Contributor

@dhruvan2006 dhruvan2006 commented Jan 22, 2025

FAILED tests/test_price_repair.py::TestPriceRepair::test_repair_bad_div_adjusts - KeyError: 'currency'
FAILED tests/test_price_repair.py::TestPriceRepair::test_repair_bad_stock_splits - KeyError: 'currentTradingPeriod'
FAILED tests/test_price_repair.py::TestPriceRepair::test_repair_zeroes_daily - AssertionError: np.False_ is not true
FAILED tests/test_prices.py::TestPriceHistory::test_duplicatingWeekly - IndexError: index -2 is out of bounds for axis 0 with size 1
FAILED tests/test_prices.py::TestPriceHistory::test_prune_post_intraday_asx - AttributeError: 'Index' object has no attribute 'date'
FAILED tests/test_prices.py::TestPriceHistory::test_prune_post_intraday_us - AttributeError: 'Index' object has no attribute 'date'
FAILED tests/test_ticker.py::TestTickerEarnings::test_earnings_dates_with_limit - AssertionError: 109 != 110 : Wrong number or rows
FAILED tests/test_ticker.py::TestTickerAnalysts::test_growth_estimates - AssertionError: Element counts were not equal:

@ValueRaider Can you verify the change made to SCR.TO repair test?

@ValueRaider
Copy link
Collaborator

Can you comment-out the CachedLimiterSession stuff not delete it? It's useful when debugging failing tests that fetch live data.

@dhruvan2006
Copy link
Contributor Author

Can you comment-out the CachedLimiterSession stuff not delete it? It's useful when debugging failing tests that fetch live data.

Yes

- name: Run all tests except cache
run: |
source .venv/bin/activate
pytest tests/ --ignore tests/test_cache.py
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also exclude test_price_repair.py. It does lots of fetches, and shouldn't be affected by most PRs. I run repair tests manually.

@ValueRaider
Copy link
Collaborator

Claude suggested some improvements to action, I'll let you review:

name: Pytest

on:
  pull_request:
    branches: [ master, main, dev ]

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v3

    - uses: actions/setup-python@v4
      with:
        python-version: "3.10"
        cache: 'pip'
        
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt pytest

    - name: Run non-cache tests
      run: pytest tests/ --ignore tests/test_cache.py -v --junitxml=test-results.xml

    - name: Run cache tests
      run: |
        pytest tests/test_cache.py::TestCache
        pytest tests/test_cache.py::TestCacheNoPermission

    - name: Upload test results
      uses: actions/upload-artifact@v3
      if: always()
      with:
        name: test-results
        path: test-results.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants