Skip to content

Commit

Permalink
Add basic tests (#56)
Browse files Browse the repository at this point in the history
* refactor: minor project structure changes

* chore: git ignore data

* chore: adjust gitignore transcripts dir

* test: add some basic tests

* test: execute tests on every branch

* test: rm redundant comment
  • Loading branch information
sudoleg authored Jun 9, 2024
1 parent fc700dc commit 1215595
Show file tree
Hide file tree
Showing 11 changed files with 902 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .github/workflows/streamlit-app.yml
name: Test streamlit app

on:
push:
branches:
- '**'

permissions:
contents: read

jobs:
test_streamlit_app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12.3"
- uses: streamlit/streamlit-app-action@v0.0.3
with:
app-path: main.py
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ design/
test/
certs/
*.ipynb
transcripts/
transcripts*/
/data/chroma/*
!/data/chroma/.gitkeep
*.sqlite3

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base stage for shared environment setup
FROM python:3.12-slim
FROM python:3.12.3-slim

# Set working directory
WORKDIR /app
Expand All @@ -14,6 +14,7 @@ RUN pip3 install -r requirements.txt
COPY . /app/

# Streamlit's configuration options
ENV PYTHONPATH="/app"
ENV STREAMLIT_CLIENT_TOOLBAR_MODE="viewer"
ENV STREAMLIT_SERVER_PORT=8501

Expand Down
Empty file added data/chroma/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def main():
)
custom_prompt = st.text_area(
"Enter a custom prompt if you want:",
key="custom_prompt_input",
help=get_default_config_value("help_texts.custom_prompt"),
)
summarize_button = st.button("Summarize")
summarize_button = st.button("Summarize", key="summarize_button")

if url != "":
try:
Expand Down
Empty file added modules/__init__.py
Empty file.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ youtube-transcript-api==0.6.2
langchain-community==0.2.4
langchain-openai==0.1.8
streamlit==1.35.0
watchdog==4.0.1
watchdog==4.0.1
pytest==8.2.2
Loading

0 comments on commit 1215595

Please sign in to comment.