diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdbbc4573..19a7f6042 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,27 +9,7 @@ on: jobs: test: - runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] - test-type: ["unit", "acceptance"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - name: Install dependencies - run: | - pip install --upgrade pip wheel - pip install .[dev] - - name: Perform unit ${{ matrix.test-type }} - env: - PYTEST_ADDOPTS: "--color=yes" - run: | - pytest -vv tests/${{ matrix.test-type }} + uses: .github/workflows/testing.yml build-docs: runs-on: ubuntu-22.04 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0589931f3..ec76731b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,27 +7,7 @@ on: jobs: test: - runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] - test-type: ["unit", "acceptance"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - name: Install dependencies - run: | - pip install --upgrade pip wheel - pip install .[dev] - - name: Perform unit ${{ matrix.test-type }} - env: - PYTEST_ADDOPTS: "--color=yes" - run: | - pytest -vv tests/${{ matrix.test-type }} + uses: .github/workflows/testing.yml code-quality: runs-on: ubuntu-22.04 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 000000000..437d41c76 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,28 @@ +name: Testing + +on: + workflow_call: + +jobs: + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + test-type: ["unit", "acceptance"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + - name: Install dependencies + run: | + pip install --upgrade pip wheel + pip install .[dev] + - name: Perform ${{ matrix.test-type }} test + env: + PYTEST_ADDOPTS: "--color=yes" + run: | + pytest -vv -s tests/${{ matrix.test-type }} diff --git a/tests/acceptance/test_http_input.py b/tests/acceptance/test_http_input.py index 69bf6f9e5..9cd5f42fb 100644 --- a/tests/acceptance/test_http_input.py +++ b/tests/acceptance/test_http_input.py @@ -36,7 +36,7 @@ def config_fixture(): "type": "http_input", "uvicorn_config": { "host": "127.0.0.1", - "port": 12681, + "port": 9000, "ssl_certfile": "tests/testdata/acceptance/http_input/cert.crt", "ssl_keyfile": "tests/testdata/acceptance/http_input/cert.key", }, @@ -62,9 +62,9 @@ def test_http_input_accepts_message_for_single_pipeline(tmp_path: Path, config: config_path = tmp_path / "generated_config.yml" config_path.write_text(config.as_yaml()) proc = start_logprep(config_path) - wait_for_output(proc, "Uvicorn running on https://127.0.0.1:12681", test_timeout=15) + wait_for_output(proc, "Uvicorn running on https://127.0.0.1:9000", test_timeout=15) - requests.post("https://127.0.0.1:12681/plaintext", data="my message", verify=False, timeout=5) + requests.post("https://127.0.0.1:9000/plaintext", data="my message", verify=False, timeout=5) time.sleep(0.5) assert "my message" in output_path.read_text() @@ -77,8 +77,8 @@ def test_http_input_accepts_message_for_multiple_pipelines(tmp_path: Path, confi config_path = tmp_path / "generated_config.yml" config_path.write_text(config.as_yaml()) proc = start_logprep(config_path) - wait_for_output(proc, "Uvicorn running on https://127.0.0.1:12681", test_timeout=15) + wait_for_output(proc, "Uvicorn running on https://127.0.0.1:9000", test_timeout=15) - requests.post("https://127.0.0.1:12681/plaintext", data="my message", verify=False, timeout=5) + requests.post("https://127.0.0.1:9000/plaintext", data="my message", verify=False, timeout=5) time.sleep(0.5) assert "my message" in output_path.read_text()