From 077e69e948b61dea88dbeaa949a41cad76077a32 Mon Sep 17 00:00:00 2001 From: Matthew Harris Date: Sat, 29 Jun 2024 19:51:38 -0400 Subject: [PATCH] Added e2e tests GH action, with docker compose build --- .github/workflows/e2e_tests.yml | 56 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 96bdfbb6..8e69239a 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -93,34 +93,36 @@ jobs: #docker compose -f docker-compose.yml -f docker-compose-dev.yml build recipedb datadb server promptflow + docker buildx create --use + docker buildx bake -f ./docker-compose.yml datadb docker-compose -f docker-compose.yml up datadb echo "DDDDDDDDD" echo "logs datadb ..." - docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs datadb - - - name: Run the stack - run: | - export DATA_DB_CONN_STRING="postgresql://${POSTGRES_DATA_USER}:${POSTGRES_DATA_PASSWORD}@${POSTGRES_DATA_HOST}:${POSTGRES_DATA_PORT}/${POSTGRES_DATA_DB}" - export POSTGRES_RECIPE_CONN_STRING="postgresql://${POSTGRES_RECIPE_USER}:${POSTGRES_RECIPE_PASSWORD}@${POSTGRES_RECIPE_HOST}:${POSTGRES_RECIPE_PORT}/${POSTGRES_RECIPE_DB}" - env > .env - #docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d recipedb datadb server promptflow - docker ps - - - name: End to End tests using Promtpflow and chainlit code - run: | - set -e - docker ps - echo "logs backend ..." - docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs server - echo "logs datadb ..." - docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs datadb - echo "logs recipesdb ..." - docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs recipedb - echo "Tests ..." - docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run create --flow . --data ./data.jsonl --stream --column-mapping query='${data.query}' context='${data.context}' chat_history='${data.chat_history}' --name base_run - docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run show-details -n base_run - docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run show-metrics -n base_run - #docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run visualize -n base_run - docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow python3 check_evaluation_results.py - docker-compose -f docker-stack.yml -f docker-compose-dev.yml down -v --remove-orphans + docker-compose -f docker-compose.yml logs datadb + + # - name: Run the stack + # run: | + # export DATA_DB_CONN_STRING="postgresql://${POSTGRES_DATA_USER}:${POSTGRES_DATA_PASSWORD}@${POSTGRES_DATA_HOST}:${POSTGRES_DATA_PORT}/${POSTGRES_DATA_DB}" + # export POSTGRES_RECIPE_CONN_STRING="postgresql://${POSTGRES_RECIPE_USER}:${POSTGRES_RECIPE_PASSWORD}@${POSTGRES_RECIPE_HOST}:${POSTGRES_RECIPE_PORT}/${POSTGRES_RECIPE_DB}" + # env > .env + # #docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d recipedb datadb server promptflow + # docker ps + + # - name: End to End tests using Promtpflow and chainlit code + # run: | + # set -e + # docker ps + # echo "logs backend ..." + # docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs server + # echo "logs datadb ..." + # docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs datadb + # echo "logs recipesdb ..." + # docker-compose -f docker-compose.yml -f docker-compose-dev.yml logs recipedb + # echo "Tests ..." + # docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run create --flow . --data ./data.jsonl --stream --column-mapping query='${data.query}' context='${data.context}' chat_history='${data.chat_history}' --name base_run + # docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run show-details -n base_run + # docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run show-metrics -n base_run + # #docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow pf run visualize -n base_run + # docker compose -f docker-compose.yml -f docker-compose-dev.yml exec --workdir /app/chainlit-ui-evaluation promptflow python3 check_evaluation_results.py + # docker-compose -f docker-stack.yml -f docker-compose-dev.yml down -v --remove-orphans