From 38f6461287b6534c15f2c9113381594d36c944c8 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Fri, 7 Jun 2024 16:44:29 +0800 Subject: [PATCH] CI optimization to support multiple test for single kind of service (#145) Signed-off-by: chensuyue --- .github/workflows/microservice-test.yml | 18 +++++++++++++++++- ...eddings.sh => test_embeddings_langchain.sh} | 0 ...lms.sh => test_llms_text-generation_tgi.sh} | 0 ...st_reranks.sh => test_reranks_langchain.sh} | 0 ...rievers.sh => test_retrievers_langchain.sh} | 0 5 files changed, 17 insertions(+), 1 deletion(-) rename tests/{test_embeddings.sh => test_embeddings_langchain.sh} (100%) rename tests/{test_llms.sh => test_llms_text-generation_tgi.sh} (100%) rename tests/{test_reranks.sh => test_reranks_langchain.sh} (100%) rename tests/{test_retrievers.sh => test_retrievers_langchain.sh} (100%) diff --git a/.github/workflows/microservice-test.yml b/.github/workflows/microservice-test.yml index 81a9f8526..bb86b2d1b 100644 --- a/.github/workflows/microservice-test.yml +++ b/.github/workflows/microservice-test.yml @@ -38,10 +38,26 @@ jobs: changed_files="$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} \ | grep 'comps/' | grep -vE '*.md|*.txt|comps/cores')" || true services=$(printf '%s\n' "${changed_files[@]}" | cut -d'/' -f2 | grep -vE '*.py' | sort -u) + path_level_1=("asr" "tts") + path_level_3=("llms") run_matrix="{\"include\":[" for service in ${services}; do hardware="gaudi" # default hardware, set based on the changed files - run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"}," + if [[ "${path_level_1[@]}" =~ "${service}" ]]; then + run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"}," + else + vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py' | sort -u) + for vendor in ${vendors}; do + if [[ "${path_level_3[@]}" =~ "${service}" ]]; then + sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py' | sort -u) + for sub_vendor in ${sub_vendors}; do + run_matrix="${run_matrix}{\"service\":\"${service}_${vendor}_${sub_vendor}\",\"hardware\":\"${hardware}\"}," + done + else + run_matrix="${run_matrix}{\"service\":\"${service}_${vendor}\",\"hardware\":\"${hardware}\"}," + fi + done + fi done run_matrix=$run_matrix"]}" echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT diff --git a/tests/test_embeddings.sh b/tests/test_embeddings_langchain.sh similarity index 100% rename from tests/test_embeddings.sh rename to tests/test_embeddings_langchain.sh diff --git a/tests/test_llms.sh b/tests/test_llms_text-generation_tgi.sh similarity index 100% rename from tests/test_llms.sh rename to tests/test_llms_text-generation_tgi.sh diff --git a/tests/test_reranks.sh b/tests/test_reranks_langchain.sh similarity index 100% rename from tests/test_reranks.sh rename to tests/test_reranks_langchain.sh diff --git a/tests/test_retrievers.sh b/tests/test_retrievers_langchain.sh similarity index 100% rename from tests/test_retrievers.sh rename to tests/test_retrievers_langchain.sh