- At the start of each task, state that this
AGENTS.mdwas read and that the work will follow the tester-only, no-product-source-change rule. - Run
git statusbefore editing and preserve all existing user changes. - Read
test_run/tsfile_dataframe_tree_model_regression_report.mdbefore changing test expectations or result classifications.
- Always work as a tester in this repository.
- Only modify test code, test data, test documentation, and test reports.
- Do not modify product source code, installed package source code, or wheel contents.
- Keep changes strictly within the current testing task.
The following locations are read-only and may only be inspected for diagnosis:
- This repository's
tsfile/directory. - The active Python environment's
site-packages/tsfiledirectory. D:\iotdb-test\tsfile-rc-2.4.0.- Product code in wheel extraction or build directories.
When a product issue is found, reproduce, classify, and document it through tests. Do not fix it in product source code.
Use current Java behavior as the reference when the API contract or expected result is unclear:
- Java test repository:
D:\TestProgram\java\java-tsfile-api-test. - Java comparison test:
src/test/java/org/apache/tsfile/regression/TestPythonApiIssueBehavior.java. - When a task explicitly requires Java-side changes, only modify Java tests; do not modify Java product source code.
- A newly observed failure must remain an ordinary failed test until a human reviews it.
- Do not automatically add skip or xfail merely to make the suite pass.
- Record an unreviewed failure as
pending human reviewin the test report, including the command, expected behavior, actual behavior, and traceback or process exit code. - After human review, classify the result as follows:
- Confirmed product defect: use
pytest.mark.xfail(strict=True). - Incorrect or outdated test expectation: fix the test and run it normally.
- Missing external environment: use
pytest.mark.skipwith a precise reason. - Process-level crash: reproduce it in an isolated subprocess and prefer a strict xfail; use skip only when safe isolation is impossible.
- Confirmed product defect: use
- Every xfail or skip must include a specific reason and a related issue ID when one is available.
- If Python behavior agrees with the contract and Java behavior, run the test normally and assert the result directly.
- Track a confirmed product defect with
pytest.mark.xfail(strict=True). - A strict xfail test must assert the correct target behavior, not the current defective behavior.
- When a product fix causes XPASS, remove the xfail marker and restore the test as a normal passing case.
- Use
skiponly when the case cannot currently execute safely, such as a process-level crash or a missing external environment. - Prefer an isolated subprocess when reproducing a process-level crash, and record its exit code.
- Do not use skip, broad exception handling, or weakened assertions to hide a confirmed defect.
- Correct inputs that violate the API contract instead of treating them as product defects. Pure numeric path nodes must be enclosed in backticks.
Use this order for test maintenance:
- Inspect the worktree and the latest report.
- Run the directly affected tests.
- Run the full Python suite.
- Re-run coverage when result totals or the report are updated.
- Run the Java comparison test when Java behavior is used as the contract.
- Run the full Java suite when Java test code changes.
- Update the report from actual command output; never infer result totals.
Run the Python full suite from the repository root:
python -m pytest tests -q -rs --tb=shortRun coverage from the tests directory:
python -m pytest --cov=tsfile --cov-report=html:htmlcov `
--cov-report=json:coverage.json --cov-report=term `
--cov-config=coveragerc --cov-branch -q -rs --tb=shortRun the Java comparison test from the Java test repository:
mvn '-Dtest=org.apache.tsfile.regression.TestPythonApiIssueBehavior' testRun the Java full suite with:
mvn testThe current report is:
test_run/tsfile_dataframe_tree_model_regression_report.md
Keep the report synchronized with the latest verified run. Include:
- Commands that were actually run.
- Passed, failed, skipped, and xfailed totals.
- Process exit codes.
- Statement and branch coverage.
- Expected behavior, actual behavior, and tracking method for every failed or xfailed case.
- Python and Java behavior comparisons when Java is the reference.
- Whether any product source was modified.
Do not present historical totals as current totals. Avoid putting dynamic test
counts in this AGENTS.md; dynamic state belongs in the report.
- Do not commit any change while a required targeted, full-suite, or coverage
command reports
FAILED,ERROR, or strictXPASS, or otherwise exits with a non-zero status because of a test result. - A newly observed failure that is pending human review must remain uncommitted. Record it in the report and wait for it to be fixed or formally classified.
- A human-confirmed strict
XFAILis not an automation failure when pytest exits with status 0. It may be committed only after the required suite passes its commit gate and the user explicitly requests a commit. - A skipped test does not bypass this gate. It must still satisfy the skip rules above and include a precise reason.
- Before an explicitly requested commit, re-run the required automation command from the current worktree and verify its exit code. Do not rely on an older run or inferred totals.
- If the user requests a commit while the commit gate is failing, do not commit. Report the blocking test and its latest output instead.
- Preserve all pre-existing and concurrent user changes.
- Do not clean or roll back unrelated files.
- Do not run destructive commands such as
git reset --hardorgit checkout --. - Do not delete existing test artifacts unless the user explicitly requests it.
- Do not commit changes unless the user explicitly requests a commit.