diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..50c4c68 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,27 @@ +name: Ruff + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + ruff: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff + - name: Analysing the code with ruff + run: | + ruff check . diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml new file mode 100644 index 0000000..1079c26 --- /dev/null +++ b/.github/workflows/pylint.yaml @@ -0,0 +1,27 @@ +name: Pylint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') diff --git a/tests/test_langflow.py b/tests/test_langflow.py new file mode 100644 index 0000000..ea76a09 --- /dev/null +++ b/tests/test_langflow.py @@ -0,0 +1,23 @@ +import os + +from dotenv import load_dotenv +import requests + +# Load environment variables from .env file +load_dotenv() + + +def test_langflow_server(): + """ + GIVEN the path to a local LangFlow server + IF a live request is made to the server + THEN the server is alive and returns 200 + """ + # Get a url on the LangFlow server + api_base = os.getenv("BASE_API_URL") + flow_id = os.getenv("FLOW_ID") + api_url = f"{api_base}/{flow_id}" + + # Make a GET request, confirm reqsult + req = requests.get(api_url) + assert req.status_code == 200