# Integration Tests

Load this file when changing `integration_tests/`, xlang behavior, compiler-generated outputs, or cross-language compatibility.

## Rules

- Run all commands from within `integration_tests/`.
- For Java-related integration tests, install the Java libraries first with `cd ../java && mvn -T16 install -DskipTests` if Java changed. If unsure, run it.
- On macOS, GraalVM is usually installed under `/Library/Java/JavaVirtualMachines/graalvm-xxx`.
- For `integration_tests/idl_tests`:
  - Always run `cd ../java && mvn -T16 install -DskipTests` before the test if Java changed since the last install. If unsure, run it.
  - Always run `cd ../python && pip install -v -e .` before the test if Python or Cython code changed. Rebuild Cython if needed.
- Never manually edit code generated by the Fory compiler for IDL tests. Regenerate it from the source IDL.

## Main Modules

- `graalvm_tests`
- `jdk_compatibility_tests`
- `jpms_tests`
- `idl_tests`
- `cpython_benchmark`

## Commands

```bash
it_dir=$(pwd)

# Run GraalVM tests
cd "$it_dir/graalvm_tests" && mvn -T16 -DskipTests=true -Pnative package && target/main

# Run JDK compatibility tests
cd "$it_dir/jdk_compatibility_tests" && mvn -T16 test

# Run JPMS tests
cd "$it_dir/jpms_tests" && mvn -T16 test

# Run Python benchmarks
cd "$it_dir/cpython_benchmark" && pip install -r requirements.txt && python benchmark.py
```

## Cross-Language Validation Note

When a change affects xlang behavior, combine these integration checks with the relevant Java-driven xlang tests from the language-specific files under `.agents/languages/`.
