From e892b891fb5969938af4dfc93bb92504eb7c64a5 Mon Sep 17 00:00:00 2001 From: BAK BYEONG JUN Date: Tue, 15 Apr 2025 09:17:28 +0000 Subject: [PATCH] init --- tasks/pytest/task.yaml | 86 +++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/tasks/pytest/task.yaml b/tasks/pytest/task.yaml index bbce771..b93230f 100644 --- a/tasks/pytest/task.yaml +++ b/tasks/pytest/task.yaml @@ -19,53 +19,53 @@ spec: description: Workspace containing the cloned Git repository from git-clone-checkout steps: -- name: install-dependencies - image: $(params.pythonImageName) - workingDir: /workspace/source/$(params.subdirectory) - env: - - name: HOME - value: /workspace/shared/$(params.subdirectory)/___HOME___ - script: | - #!/usr/bin/env bash - set -e + - name: install-dependencies + image: $(params.pythonImageName) + workingDir: /workspace/source/$(params.subdirectory) + env: + - name: HOME + value: /workspace/shared/$(params.subdirectory)/___HOME___ + script: | + #!/usr/bin/env bash + set -e - echo "HOME=$HOME" - echo "๐Ÿ”ง Installing dependencies..." + echo "HOME=$HOME" + echo "๐Ÿ”ง Installing dependencies..." - pip install --upgrade pip --root-user-action=ignore - pip install pytest --root-user-action=ignore + pip install --upgrade pip --root-user-action=ignore + pip install pytest --root-user-action=ignore - if [ -f pyproject.toml ]; then - echo "[INFO] Poetry project detected" - pip install poetry --root-user-action=ignore + if [ -f pyproject.toml ]; then + echo "[INFO] Poetry project detected" + pip install poetry --root-user-action=ignore - echo "[INFO] Using pre-configured poetry settings from $HOME/.config/pypoetry/" - poetry lock --no-cache --no-update - poetry install - elif [ -f requirements.txt ]; then - echo "[INFO] Using pip to install dependencies" - pip install -r requirements.txt --root-user-action=ignore - else - echo "[WARN] No dependency file found" - fi + echo "[INFO] Using pre-configured poetry settings from $HOME/.config/pypoetry/" + poetry lock --no-cache --no-update + poetry install + elif [ -f requirements.txt ]; then + echo "[INFO] Using pip to install dependencies" + pip install -r requirements.txt --root-user-action=ignore + else + echo "[WARN] No dependency file found" + fi - echo "๐Ÿงช Running tests..." - set +e - if [ -f pyproject.toml ]; then - poetry run pytest --verbose --junitxml=/workspace/source/pytest-results.xml - else - pytest --verbose --junitxml=/workspace/source/pytest-results.xml - fi - TEST_EXIT_CODE=$? - set -e + echo "๐Ÿงช Running tests..." + set +e + if [ -f pyproject.toml ]; then + poetry run pytest --verbose --junitxml=/workspace/source/pytest-results.xml + else + pytest --verbose --junitxml=/workspace/source/pytest-results.xml + fi + TEST_EXIT_CODE=$? + set -e - echo "๐Ÿ“„ Checking test results..." - if [ -f /workspace/source/pytest-results.xml ]; then - echo "Test results:" - cat /workspace/source/pytest-results.xml - else - echo "โŒ No test results found" - exit 1 - fi + echo "๐Ÿ“„ Checking test results..." + if [ -f /workspace/source/pytest-results.xml ]; then + echo "Test results:" + cat /workspace/source/pytest-results.xml + else + echo "โŒ No test results found" + exit 1 + fi - exit $TEST_EXIT_CODE + exit $TEST_EXIT_CODE