Atharva Thakur commited on
Commit
2971a70
β€’
1 Parent(s): 584463e

Update StreamlitTesting.yml

Browse files
.github/workflows/StreamlitTesting.yml CHANGED
@@ -1,4 +1,4 @@
1
- name: Streamlit app
2
 
3
  on:
4
  push:
@@ -10,17 +10,27 @@ permissions:
10
  contents: read
11
 
12
  jobs:
13
- streamlit:
 
14
  runs-on: ubuntu-latest
 
15
  steps:
16
- - uses: actions/checkout@v4
17
- - uses: actions/setup-python@v5
18
- with:
19
- python-version: '3.11'
20
- - name: Set up environment variables
21
- run: |
22
- echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" >> $GITHUB_ENV
23
- - uses: streamlit/streamlit-app-action@v0.0.3
24
- with:
25
- app-path: app.py
26
- # ruff: true
 
 
 
 
 
 
 
 
 
1
+ name: Python application
2
 
3
  on:
4
  push:
 
10
  contents: read
11
 
12
  jobs:
13
+ build:
14
+
15
  runs-on: ubuntu-latest
16
+
17
  steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Python 3.10
20
+ uses: actions/setup-python@v3
21
+ with:
22
+ python-version: "3.10"
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install flake8 pytest
27
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28
+ - name: Lint with flake8
29
+ run: |
30
+ # stop the build if there are Python syntax errors or undefined names
31
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34
+ - name: Test with pytest
35
+ run: |
36
+ pytest -vv
test.py β†’ Experiments.py RENAMED
File without changes
requirements.txt CHANGED
@@ -6,4 +6,6 @@ seaborn
6
  langchain-google-genai
7
  langchain-experimental
8
  python-dotenv
9
- tabulate
 
 
 
6
  langchain-google-genai
7
  langchain-experimental
8
  python-dotenv
9
+ tabulate
10
+
11
+ pytest
test_app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ from streamlit.testing.v1 import AppTest
2
+
3
+ def test_smoke():
4
+ """Basic smoke test"""
5
+ at = AppTest.from_file("app.py", default_timeout=10).run()
6
+ # Supported elements are primarily exposed as properties on the script
7
+ # results object, which returns a sequence of that element.
8
+ assert not at.exception
9
+