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

Merged
merged 2 commits into from
Feb 1, 2025

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

@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

@dhruvan2006
Copy link
Contributor Author

Excluded test_price_repair.py

I think it would be better to upload test-results on push to main/dev if you want to display them as a badge on README for example, rather than uploading them on the pull_requests

@ValueRaider ValueRaider merged commit 0da7549 into ranaroussi:dev Feb 1, 2025
3 checks passed
@ValueRaider ValueRaider mentioned this pull request Feb 15, 2025
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