Skip to content

Commit

Permalink
debug statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
roekatz committed Nov 10, 2024
1 parent fa80246 commit 8897980
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 40 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,44 @@ on:
workflow_dispatch:

jobs:
build:
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f ./tests/requirements.txt ]; then pip install -r ./tests/requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
# build:
# services:
# redis:
# image: redis
# ports:
# - 6379:6379
# options: >-
# --health-cmd "redis-cli ping"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# runs-on: ubuntu-latest
# timeout-minutes: 60
# strategy:
# matrix:
# python-version: ["3.9", "3.10", "3.11", "3.12"]

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install flake8
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# if [ -f ./tests/requirements.txt ]; then pip install -r ./tests/requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# pytest

test-docker:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions app-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ function test_data_publish {
function test_statistics {
echo "- Testing statistics feature"
# Make sure 2 servers & 2 clients (repeat few times cause different workers might response)
for _ in {1..5}; do
curl -s 'http://localhost:7002/stats' --header "Authorization: Bearer $OPAL_DATA_SOURCE_TOKEN" | grep '"client_count":2,"server_count":2'
for port in {7002..7003}; do
for _ in {1..10}; do
stats_output=$(curl -s "http://localhost:${port}/stats" --header "Authorization: Bearer $OPAL_DATA_SOURCE_TOKEN")
echo $stats_output | grep '"client_count":2,"server_count":2'
echo $stats_output
done
done
curl -s 'http://localhost:7002/stats' --header "Authorization: Bearer $OPAL_DATA_SOURCE_TOKEN"
}
Expand Down

0 comments on commit 8897980

Please sign in to comment.