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: tests-pytest add skip-install #428

Merged

Conversation

anscfrisson
Copy link
Contributor

This PR proposes add a missing definition of the skip-install input in tests-pytest/action.yml:

  skip-install:
    description: >
      Whether to skip install. 
      Should be false with poetry as build-backend.
      The default value is ``false``.
    default: false
    required: false
    type: boolean

Noticed with https://github.com/ansys-internal/simba-core/actions/runs/8327410143/job/22785207488

Run if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
/home/runner/work/_temp/508acb6f-5ce8-452e-84cd-fd2b2305b3de.sh: line 2: poetry: command not found

This is because inputs.skip-install does not exist, then this step that installs poetry is skipped in tests-pytest/action.yml

    - name: "Install project (if required)"
      if: inputs.skip-install == 'false'
      shell: bash
      run: |
        if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
          python -m pip install poetry
          poetry install
        else
          python -m pip install .
        fi

Then, with skip-install: false added:
https://github.com/ansys-internal/simba-core/pull/6/commits/191f76402b87d06257706c40c0129dbebc86011e

.github/workflows/ci_cd.yml

      - uses: ansys/actions/tests-pytest@d34d2c5cc77e0bfe0afcb6d913f38e0ad8c5f7bf
        with:
          pytest-extra-args: "--cov=ansys --cov-report=term --cov-report=html:.cov/html"
          skip-install: false

Then in https://github.com/ansys-internal/simba-core/actions/runs/8327598885/job/22785773885 poetry install is restored

...
Run if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
  if grep -q 'build-backend = "poetry\.core\.masonry\.api"' "pyproject.toml"; then
    python -m pip install poetry
    poetry install
  else
    python -m pip install .
  fi
...

@anscfrisson anscfrisson requested a review from a team as a code owner March 18, 2024 18:31
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@anscfrisson
Copy link
Contributor Author

anscfrisson commented Mar 18, 2024

https://github.com/ansys/actions/actions/runs/8331850513/job/22799631853?pr=428

Run actions-ecosystem/action-add-labels@v1
Error: HttpError: Resource not accessible by integration
Error: Resource not accessible by integration

I am afraid that without access to https://github.com/ansys/actions-ecosystem I am unable to get further insight to fix this issue.

@anscfrisson anscfrisson changed the title Fix/tests pytests/inputs/add skip install fix: tests-pytest/action.yml: inputs: add skip-install Mar 18, 2024
@anscfrisson
Copy link
Contributor Author

@ansys-reviewer-bot review

@ansys-reviewer-bot
Copy link
Contributor

Okay, I will trigger a review of your PR.

tests-pytest/action.yml: apply suggestions from ansys-reviewer-bot

Co-authored-by: ansys-reviewer-bot[bot] <143693109+ansys-reviewer-bot[bot]@users.noreply.github.com>
@anscfrisson
Copy link
Contributor Author

anscfrisson commented Mar 18, 2024

https://github.com/ansys/actions/actions/runs/8331850513/job/22799631853?pr=428

Run actions-ecosystem/action-add-labels@v1
Error: HttpError: Resource not accessible by integration
Error: Resource not accessible by integration

I am afraid that without access to https://github.com/ansys/actions-ecosystem I am unable to get further insight to fix this issue.

@RobPasMue This PR #428 is related to #423 where if: inputs.skip-install == 'false' was introduced. Could you please help me fix the validation?

@RobPasMue RobPasMue changed the title fix: tests-pytest/action.yml: inputs: add skip-install fix: tests-pytest add skip-install Mar 19, 2024
@RobPasMue
Copy link
Member

This is failing because you opened a PR from a forked repository. Secret access is therefore forbidden. I have given you write access for upcoming occasions :) I will merge this PR as is since it works just fine. Thanks @anscfrisson!

Next time you will be able to create a branch on this repo directly.

@RobPasMue RobPasMue merged commit bd279a8 into ansys:main Mar 19, 2024
10 of 11 checks passed
@anscfrisson
Copy link
Contributor Author

This is failing because you opened a PR from a forked repository. Secret access is therefore forbidden. I have given you write access for upcoming occasions :) I will merge this PR as is since it works just fine. Thanks @anscfrisson!

Next time you will be able to create a branch on this repo directly.

Thank you @RobPasMue !

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.

None yet

2 participants