From 85803e95f19b092201f725546272916534b5b0a4 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 14 May 2023 23:39:14 +0200 Subject: [PATCH] Fixes les commandes d'execution pour python Rends git ignorant du cache python Fixes les commandes d'execution pour python en local Ajoutes une commande d'execution de la CI selon la branche cicd --- .gitignore | 3 +++ .gitlab/.gitlab-ci.yml | 12 +++++++----- .vscode/launch.json | 23 +++++++++++++++++++++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 21c24bb..6de641b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ # Ignore node_module **/node_modules/ + +# Ignore python stuff +**/__pycache__ \ No newline at end of file diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 6dd2787..601a98f 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -16,7 +16,8 @@ variables: image: node:latest rules: - if: $CI_COMMIT_TAG - when: never # Do not run this job when a tag is created manually + when: never + - if: CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd" - changes: - ${ENTRY_FOLDER}/${PACKAGE_NAME}/* script: @@ -40,12 +41,13 @@ manifest-job/valid_set: stage: Test image: python:latest rules: + - if: CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "cicd" - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: - ${ENTRY_FOLDER}/${PACKAGE_NAME}/* script: - pip install -U pytest pillow iteration_utilities - - python -m pytest src/test_images_job/test_wpp.py --tb=line -rA --color=yes --code-highlight=yes -q + - python -m pytest src/test_images.py --tb=line -rA allow_failure: true test-images-job/valid_set: @@ -64,7 +66,7 @@ test-images-job/missing_tag_set: image: javieraviles/zip:latest rules: - if: $CI_COMMIT_TAG - when: never # Do not run this job when a tag is created manually + when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH changes: - ${ENTRY_FOLDER}/${PACKAGE_NAME}/* @@ -91,7 +93,7 @@ bundle-job/missing_tag_set: image: curlimages/curl:latest rules: - if: $CI_COMMIT_TAG - when: never # Do not run this job when a tag is created manually + when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH changes: - ${ENTRY_FOLDER}/${PACKAGE_NAME}/* @@ -120,7 +122,7 @@ upload-job/missing_tag_set: image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - if: $CI_COMMIT_TAG - when: never # Do not run this job when a tag is created manually + when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH changes: - ${ENTRY_FOLDER}/${PACKAGE_NAME}/* diff --git a/.vscode/launch.json b/.vscode/launch.json index 2c4d49a..6a1ef3c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,7 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "Gen Valid_set", + "name": "Gen-Manifest Valid_set", "cwd": "${workspaceFolder}/src", "type": "node", "request": "launch", @@ -20,7 +20,7 @@ ], }, { - "name": "Test Valid_set", + "name": "Test-Manifest Valid_set", "cwd": "${workspaceFolder}/src", "type": "node", "request": "launch", @@ -37,5 +37,24 @@ "/**" ], }, + { + "name": "Test-Images Valid_set", + "cwd": "${workspaceFolder}/src", + "console": "internalConsole", + "type": "python", + "request": "launch", + "module": "pytest", + "args": [ + "test_images.py", + "-rA", + "--tb=line", + "--color=yes" + ], + "env": { + "ENTRY_FOLDER": "${workspaceFolder}/test", + "PACKAGE_NAME": "valid_set" + }, + "justMyCode": true + }, ] } \ No newline at end of file