Skip to content

Commit

Permalink
First commit of using Selenium instead of mock classes for e2e tests.…
Browse files Browse the repository at this point in the history
… MUCH simpler.
  • Loading branch information
dividor committed Jul 6, 2024
1 parent 1d398d4 commit 698cfec
Show file tree
Hide file tree
Showing 3 changed files with 248 additions and 350 deletions.
45 changes: 43 additions & 2 deletions flows/chainlit-ui-evaluation/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
FROM mcr.microsoft.com/azureml/promptflow/promptflow-runtime-stable:latest

# No need to copy the app code, we mount via docker-compose-dev.yml
ARG OPENAI_API_KEY
ENV OPENAI_API_KEY=$OPENAI_API_KEY

ARG OPENAI_API_ENDPOINT
ENV OPENAI_API_ENDPOINT=$OPENAI_API_ENDPOINT

COPY ./flows /app
COPY ./utils /app/chainlit-ui-evaluation/utils
COPY ./templates /app/chainlit-ui-evaluation/templates
COPY ./management/skills.py /app/chainlit-ui-evaluation/recipes/skills.py
COPY ./ui/chat-chainlit-assistant/app.py /app/chainlit-ui-evaluation/app.py

RUN pip3 install --upgrade pip
RUN pip3 install chainlit==1.1.305

WORKDIR /app/chainlit-ui-evaluation

# Needed for running chainlit code if using Mock tests
RUN pip3 install chainlit==1.1.305
RUN pip3 install langchain==0.2.1
RUN pip3 install langchain_openai==0.1.7
RUN pip3 install psycopg2_binary==2.9.9
RUN pip install keyrings.alt

# Set up Connections
RUN pf connection create --file ./openai.yaml --set api_key=$OPENAI_API_KEY --name open_ai_connection
RUN pf connection create --file ./azure_openai.yaml --set api_key=$OPENAI_API_KEY --set api_base=$OPENAI_API_ENDPOINT --name azure_openai

# ======= SELENIUM BEGIN ========

# Update package lists for the Ubuntu system
RUN apt-get update

# Download Chrome Debian package
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

# Install the Chrome Debian package
RUN apt install ./google-chrome-stable_current_amd64.deb -y

# Print the version of Google Chrome installed
RUN google-chrome --version

RUN pip install selenium==4.22.0
RUN pip install chromedriver-py==126.0.6478.126

# ======= SELENIUM END ========
Loading

0 comments on commit 698cfec

Please sign in to comment.