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

New DB in GitHub Actions after restoring environment & .testmondata from cache #236

Open
alankritjoshi opened this issue Aug 13, 2024 · 0 comments

Comments

@alankritjoshi
Copy link

What is your setup and what steps did you do?
Please show us also the command/s you executed. What is the code you used?

I am trying to use testmon in Github Actions so that the PRs run only new changes against the cached .testmondata (generated by main branch)

pr.yml

      - name: Checkout code
        uses: actions/checkout@v4

      - name: Poetry
        shell: bash
        run: |
          pip install pipx
          pipx ensurepath
          pipx install poetry==1.8.2

          pipx install poethepoet==0.25.0
          poetry config virtualenvs.in-project true

      - name: Setup Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'
          cache: 'poetry'

      - name: Install
        run: |
          poetry install

      - name: Pytest cache restore
        uses: actions/cache/restore@v3
        with:
          path: .testmondata
          key: testmon-main-${{ github.sha }}
          restore-keys: |
            testmon-main-

      - name: Run tests
        run: |
          poetry run pytest --testmon

What was the outcome?
Please also copy (redacted if need be) pytest output including the pytest version, plugins list and versions and pytest rootdir here

All the tests are re-run instead of running only relevant changed/added tests.

I noticed, each run starts with:

testmon: new DB, environment: default

I am not sure why it initializes a new DB if .testmondata is restored from cache.

What did you expect instead?

Testmon works as expected and only runs changed tests by using the cache recovered .testmondata.

What is your operating system and it's version please?

Ubuntu Github Action runner

@alankritjoshi alankritjoshi changed the title New DB in GitHub Actions even after restoring environment and .testmondata New DB in GitHub Actions after restoring environment and .testmondata from cache Aug 13, 2024
@alankritjoshi alankritjoshi changed the title New DB in GitHub Actions after restoring environment and .testmondata from cache New DB in GitHub Actions after restoring environment & .testmondata from cache Aug 13, 2024
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

No branches or pull requests

1 participant