Skip to content

Commit

Permalink
PR checks without vault login
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Sep 14, 2023
1 parent f328479 commit 2051a3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ jobs:

- name: Collect Tests
run: |
# To skip vault login in pull request checks
export VAULT_SECRET_ID_FOR_DYNACONF=somesecret
pytest --collect-only --disable-pytest-warnings tests/foreman/ tests/robottelo/
pytest --collect-only --disable-pytest-warnings -m pre_upgrade tests/upgrades/
pytest --collect-only --disable-pytest-warnings -m post_upgrade tests/upgrades/
- name: Collect Tests with xdist
run: |
# To skip vault login in pull request checks
export VAULT_SECRET_ID_FOR_DYNACONF=somesecret
pytest --collect-only --setup-plan --disable-pytest-warnings -n 2 tests/foreman/ tests/robottelo/
pytest --collect-only --setup-plan --disable-pytest-warnings -n 2 -m pre_upgrade tests/upgrades/
pytest --collect-only --setup-plan --disable-pytest-warnings -n 2 -m post_upgrade tests/upgrades/
Expand Down
5 changes: 1 addition & 4 deletions robottelo/utils/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ def exec_vault_command(self, command: str, **kwargs):
return vcommand

def login(self, **kwargs):
if (
re.search(r'\s*#.*VAULT_SECRET_ID_FOR_DYNACONF', self.env_path.read_text())
and 'VAULT_SECRET_ID_FOR_DYNACONF' not in os.environ
):
if 'VAULT_SECRET_ID_FOR_DYNACONF' not in os.environ:
if self.status(**kwargs).returncode != 0:
logger.warning(
"Warning! The browser is about to open for vault OIDC login, "
Expand Down

0 comments on commit 2051a3e

Please sign in to comment.