You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add common pitfalls and improve PR checklist in development guide (#3231)
Add a new "Common Build and Test Pitfalls" section documenting:
- Native code must be built before running JVM tests
- Debug vs release mode (release only needed for benchmarking)
- LD_LIBRARY_PATH requirement for libjvm.so when running Rust tests
- Avoid using -pl to select modules (stale common module issue)
- Use wildcardSuites for flexible test matching
Restructure "Submitting a Pull Request" section as a numbered checklist:
1. Format code with `make format`
2. Build and verify with `make`
3. Run Clippy (recommended)
4. Run tests
Add a quick Pre-PR Summary command reference.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Alternatively, use `make test-rust` which handles the JVM compilation dependency automatically.
91
+
92
+
### Avoid Using `-pl` to Select Modules
93
+
94
+
When running Maven tests, avoid using `-pl spark` to select only the spark module. This can cause
95
+
Maven to pick up the `common` module from your local Maven repository instead of using the current
96
+
codebase, leading to inconsistent test results:
97
+
98
+
```sh
99
+
# Avoid this - may use stale common module from local repo
100
+
./mvnw test -pl spark -Dsuites="..."
101
+
102
+
# Do this instead - builds and tests with current code
103
+
./mvnw test -Dsuites="..."
104
+
```
105
+
106
+
### Use `wildcardSuites` for Running Tests
107
+
108
+
When running specific test suites, use `wildcardSuites` instead of `suites` for more flexible
109
+
matching. The `wildcardSuites` parameter allows partial matching of suite names:
110
+
111
+
```sh
112
+
# Run all suites containing "CometCast"
113
+
./mvnw test -DwildcardSuites="CometCast"
114
+
115
+
# Run specific suite with filter
116
+
./mvnw test -Dsuites="org.apache.comet.CometCastSuite valid"
117
+
```
118
+
51
119
## Development Environment
52
120
53
121
Comet is a multi-language project with native code written in Rust and JVM code written in Java and Scala.
@@ -161,10 +229,31 @@ It is possible to debug both native and JVM code concurrently as described in th
161
229
162
230
## Submitting a Pull Request
163
231
232
+
Before submitting a pull request, follow this checklist to ensure your changes are ready:
233
+
234
+
### 1. Format Your Code
235
+
164
236
Comet uses `cargo fmt`, [Scalafix](https://github.com/scalacenter/scalafix) and [Spotless](https://github.com/diffplug/spotless/tree/main/plugin-maven) to
165
-
automatically format the code. Before submitting a pull request, you can simply run `make format` to format the code.
237
+
automatically format the code. Run the following command to format all code:
238
+
239
+
```sh
240
+
make format
241
+
```
242
+
243
+
### 2. Build and Verify
244
+
245
+
After formatting, run a full build to ensure everything compiles correctly and generated
246
+
documentation is up to date:
247
+
248
+
```sh
249
+
make
250
+
```
166
251
167
-
Additionally, it's strongly recommended to run Clippy locally to catch potential issues before the CI/CD pipeline does. You can run the same Clippy checks used in CI/CD with:
252
+
This builds both native and JVM code. Fix any compilation errors before proceeding.
253
+
254
+
### 3. Run Clippy (Recommended)
255
+
256
+
It's strongly recommended to run Clippy locally to catch potential issues before the CI/CD pipeline does. You can run the same Clippy checks used in CI/CD with:
0 commit comments