Run Pebblo Integration Tests #521
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Pebblo Integration Tests | |
on: | |
schedule: | |
- cron: '30 2,14 * * *' | |
workflow_dispatch: # Activate this workflow manually | |
env: | |
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11.x' }} | |
OPENAI_API_KEY_SECRET: ${{ secrets.OPENAI_API_KEY }} | |
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | |
SLACK_CH: ${{ secrets.SLACK_CH }} | |
jobs: | |
Setup_Pebblo_Run_Tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
langchain-community-version: ["0.2.10", "0.2.12", "0.2.16", "0.3.0"] | |
python-version: ["3.10.15", "3.11.10", "3.12.6"] | |
name: Running tests on Python ${{ matrix.python-version }} & langchain-community ${{ matrix.langchain-community-version }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
ref: 'main' | |
python-version: ${{ matrix.python-version }} | |
- name: Build Pebblo | |
run: | | |
pip install build | |
python -m build --wheel | |
ls -la dist/ | |
- name: Install Pebblo Packages | |
run: | | |
echo 'Install Pebblo Package' | |
pkg_file=$(ls dist | grep .whl) | |
pip3 install dist/$pkg_file --force-reinstall | |
pip3 install --upgrade pip | |
- name: Start Pebblo Server | |
run: | | |
echo 'Running Pebblo server' | |
sleep 10 | |
pebblo & | |
sleep 120 | |
- name: Verify Pebblo Server | |
run: | | |
cat /tmp/logs/pebblo.log | |
if grep -q "Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)" /tmp/logs/pebblo.log; then | |
echo "Server started successfully." | |
else | |
echo "Unexpected issue detected at server." | |
exit 1 | |
fi | |
- name: Update requirements.txt with langchain-community version | |
run: | | |
sed -i "s/langchain-community/langchain-community==${{ matrix.langchain-community-version }}/" tests/integration/samples/requirements.txt | |
- name: Install Required Sample Application Dependencies | |
run: | | |
echo 'Install Sample Application dependency' | |
pip3 install --upgrade pip | |
pip3 install -r tests/integration/samples/requirements.txt --force-reinstall | |
- name: Run Sample RAG App | |
run: | | |
export OPENAI_API_KEY=$OPENAI_API_KEY_SECRET | |
echo 'Running pebblo_csvloader Samples' | |
cd tests/integration/samples/pebblo_csv_loader | |
python3 pebblo_csvloader.py | |
cd ../../ | |
sleep 300 | |
- name: Check Pebblo App Run Logs | |
run: | | |
cat /tmp/logs/pebblo.log | |
- name: Upload Pebblo App Run Logs as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Pebblo_Report_${{ matrix.python-version }}_${{ matrix.langchain-community-version }} | |
path: | | |
/tmp/logs/pebblo.log | |
- name: Check logs for Pebblo Report | |
run: | | |
if grep -q "INFO - PDF report generated, please check path : /home/runner/.pebblo/" /tmp/logs/pebblo.log; then | |
echo "Report Generated Successfully." | |
else | |
echo "Unexpected issue detected at running sample app." | |
cat /tmp/logs/pebblo.log | |
exit 1 | |
fi | |
- name: Upload Pebblo Report File | |
run: | | |
cd /home/runner/.pebblo/Pebblo_Automation_Testing_CSVLoader | |
curl -F file=@pebblo_report.pdf https://slack.com/api/files.upload -H "Authorization: Bearer $SLACK_TOKEN" -F channels=$SLACK_CH -F "initial_comment=Pebblo Nightly Report" | |
- name: Report Status if test case or build failure | |
if: always() | |
uses: ravsamhq/notify-slack-action@master | |
with: | |
status: ${{ job.status }} | |
notify_when: 'failure' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SECRET }} |