SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
tests(integration): organize querier test and use numbered prefixes (#9969)
Srikanth Chekurifd13c6dee4a7
diff --git a/docs/contributing/go/integration.md b/docs/contributing/go/integration.mdindex 720f3a0ed9..20afd8fdaa 100644--- a/docs/contributing/go/integration.md+++ b/docs/contributing/go/integration.md@@ -79,15 +79,15 @@ Python and pytest form the foundation of the integration testing framework. Test└── src└── bootstrap├── __init__.py- ├── a_database.py- ├── b_register.py- └── c_license.py+ ├── 01_database.py+ ├── 02_register.py+ └── 03_license.py```Each test suite follows some important principles:1. **Organization**: Test suites live under `src/` in self-contained packages. Fixtures (a pytest concept) live inside `fixtures/`.-2. **Execution Order**: Files are prefixed with `a_`, `b_`, `c_` to ensure sequential execution.+2. **Execution Order**: Files are prefixed with two-digit numbers (`01_`, `02_`, `03_`) to ensure sequential execution.3. **Time Constraints**: Each suite should complete in under 10 minutes (setup takes ~4 mins).### Test Suite Design@@ -109,7 +109,7 @@ Other test suites can be **pipelines, auth, querier.**## How to write an integration test?-Now start writing an integration test. Create a new file `src/bootstrap/e_version.py` and paste the following:+Now start writing an integration test. Create a new file `src/bootstrap/05_version.py` and paste the following:```pythonimport requests@@ -127,7 +127,7 @@ def test_version(signoz: types.SigNoz) -> None:We have written a simple test which calls the `version` endpoint of the container in step 1. In **order to just run this function, run the following command:**```bash-uv run pytest --basetemp=./tmp/ -vv --reuse src/bootstrap/e_version.py::test_version+uv run pytest --basetemp=./tmp/ -vv --reuse src/bootstrap/05_version.py::test_version```> Note: The `--reuse` flag is used to reuse the environment if it is already running. Always use this flag when writing and running integration tests. If you don't use this flag, the environment will be destroyed and recreated every time you run the test.@@ -184,8 +184,8 @@ uv run pytest --basetemp=./tmp/ -vv --reuse src/auth/```bashuv run pytest --basetemp=./tmp/ -vv --reuse src/<suite>/<file>.py::test_name-# Run test_register in file a_register.py in auth suite-uv run pytest --basetemp=./tmp/ -vv --reuse src/auth/a_register.py::test_register+# Run test_register in file 01_register.py in passwordauthn suite+uv run pytest --basetemp=./tmp/ -vv --reuse src/passwordauthn/01_register.py::test_register```## How to configure different options for integration tests?@@ -207,7 +207,7 @@ uv run pytest --basetemp=./tmp/ -vv --reuse --sqlstore-provider=postgres --postg- **Always use the `--reuse` flag** when setting up the environment to keep containers running- **Use the `--teardown` flag** when cleaning up to avoid resource leaks-- **Follow the naming convention** with alphabetical prefixes for test execution order+- **Follow the naming convention** with two-digit numeric prefixes (`01_`, `02_`) for test execution order- **Use proper timeouts** in HTTP requests to avoid hanging tests- **Clean up test data** between tests to avoid interference- **Use descriptive test names** that clearly indicate what is being testeddiff --git a/tests/integration/pyproject.toml b/tests/integration/pyproject.tomlindex b032f2cb07..adb077e05c 100644--- a/tests/integration/pyproject.toml+++ b/tests/integration/pyproject.toml@@ -38,6 +38,15 @@ ignore = [".venv"][tool.pylint.format]max-line-length = "400"+[tool.pylint.basic]+# test ordering (example; 01_abc.py)+module-rgx = "(([0-9]+_)?[a-z_][a-z0-9_]*)|(__.*__)$"++# to avoid overly restrictive pylint naming for attributes+attr-rgx = "([A-Z_][A-Z0-9_]*|[a-z_][a-z0-9_]*|(__.*__))$"+class-attribute-rgx = "([A-Z_][A-Z0-9_]*|[a-z_][a-z0-9_]*|(__.*__))$"+class-const-rgx = "[A-Z_][A-Z0-9_]*$"+[tool.pylint."messages control"]disable = ["missing-module-docstring", "missing-function-docstring", "missing-class-docstring", "duplicate-code", "dangerous-default-value", "too-many-positional-arguments", "too-many-arguments", "too-few-public-methods", "too-many-instance-attributes", "too-many-locals", "too-many-statements", "too-many-lines"]diff --git a/tests/integration/src/callbackauthn/a_domain.py b/tests/integration/src/callbackauthn/01_domain.pysimilarity index 100%rename from tests/integration/src/callbackauthn/a_domain.pyrename to tests/integration/src/callbackauthn/01_domain.pydiff --git a/tests/integration/src/callbackauthn/b_saml.py b/tests/integration/src/callbackauthn/02_saml.pysimilarity index 100%rename from tests/integration/src/callbackauthn/b_saml.pyrename to tests/integration/src/callbackauthn/02_saml.pydiff --git a/tests/integration/src/callbackauthn/c_oidc.py b/tests/integration/src/callbackauthn/03_oidc.pysimilarity index 100%rename from tests/integration/src/callbackauthn/c_oidc.pyrename to tests/integration/src/callbackauthn/03_oidc.pydiff --git a/tests/integration/src/cloudintegrations/a_get_connection_params.py b/tests/integration/src/cloudintegrations/01_get_connection_params.pysimilarity index 100%rename from tests/integration/src/cloudintegrations/a_get_connection_params.pyrename to tests/integration/src/cloudintegrations/01_get_connection_params.pydiff --git a/tests/integration/src/dashboard/a_public_dashboard.py b/tests/integration/src/dashboard/01_public_dashboard.pysimilarity index 100%rename from tests/integration/src/dashboard/a_public_dashboard.pyrename to tests/integration/src/dashboard/01_public_dashboard.pydiff --git a/tests/integration/src/logspipelines/a_logs_pipelines.py b/tests/integration/src/logspipelines/01_logs_pipelines.pysimilarity index 100%rename from tests/integration/src/logspipelines/a_logs_pipelines.pyrename to tests/integration/src/logspipelines/01_logs_pipelines.pydiff --git a/tests/integration/src/passwordauthn/a_register.py b/tests/integration/src/passwordauthn/01_register.pysimilarity index 100%rename from tests/integration/src/passwordauthn/a_register.pyrename to tests/integration/src/passwordauthn/01_register.pydiff --git a/tests/integration/src/passwordauthn/b_license.py b/tests/integration/src/passwordauthn/02_license.pysimilarity index 100%rename from tests/integration/src/passwordauthn/b_license.pyrename to tests/integration/src/passwordauthn/02_license.pydiff --git a/tests/integration/src/passwordauthn/c_apikey.py b/tests/integration/src/passwordauthn/03_apikey.pysimilarity index 100%rename from tests/integration/src/passwordauthn/c_apikey.pyrename to tests/integration/src/passwordauthn/03_apikey.pydiff --git a/tests/integration/src/passwordauthn/d_password.py b/tests/integration/src/passwordauthn/04_password.pysimilarity index 100%rename from tests/integration/src/passwordauthn/d_password.pyrename to tests/integration/src/passwordauthn/04_password.pydiff --git a/tests/integration/src/passwordauthn/e_role.py b/tests/integration/src/passwordauthn/05_role.pysimilarity index 100%rename from tests/integration/src/passwordauthn/e_role.pyrename to tests/integration/src/passwordauthn/05_role.pydiff --git a/tests/integration/src/preference/a_user.py b/tests/integration/src/preference/01_user.pysimilarity index 100%rename from tests/integration/src/preference/a_user.pyrename to tests/integration/src/preference/01_user.pydiff --git a/tests/integration/src/preference/b_org.py b/tests/integration/src/preference/02_org.pysimilarity index 100%rename from tests/integration/src/preference/b_org.pyrename to tests/integration/src/preference/02_org.pydiff --git a/tests/integration/src/querier/a_logs.py b/tests/integration/src/querier/01_logs.pysimilarity index 100%rename from tests/integration/src/querier/a_logs.pyrename to tests/integration/src/querier/01_logs.pydiff --git a/tests/integration/src/querier/d_logs_json_body.py b/tests/integration/src/querier/02_logs_json_body.pysimilarity index 100%rename from tests/integration/src/querier/d_logs_json_body.pyrename to tests/integration/src/querier/02_logs_json_body.pydiff --git a/tests/integration/src/querier/c_metrics.py b/tests/integration/src/querier/03_metrics.pysimilarity index 100%rename from tests/integration/src/querier/c_metrics.pyrename to tests/integration/src/querier/03_metrics.pydiff --git a/tests/integration/src/querier/b_traces.py b/tests/integration/src/querier/04_traces.pysimilarity index 100%rename from tests/integration/src/querier/b_traces.pyrename to tests/integration/src/querier/04_traces.pydiff --git a/tests/integration/src/ttl/a_ttl.py b/tests/integration/src/ttl/01_ttl.pysimilarity index 100%rename from tests/integration/src/ttl/a_ttl.pyrename to tests/integration/src/ttl/01_ttl.py