mattcasters opened a new pull request, #7970:
URL: https://github.com/apache/hop/pull/7970
## Summary
Addresses #7968: a desktop `./mvnw clean install` still runs the SWTBot
`@Tag("uitest")` suite on the interactive display, so dialogs steal focus for
~15 minutes.
This does **not** move Maven into Docker. It moves the **display**:
- `tools/with-isolated-display.sh` wraps any command (typically `./mvnw`)
- On Linux it prefers host `xvfb-run` (same as Jenkins)
- If `xvfb-run` is missing, it starts the tiny Xvfb sidecar in
`docker/ui-tests/` and points `DISPLAY` at the Unix socket
- `-Pskip-uitest` is the explicit escape hatch
- `-Puitest` still means **only** UI tests
`DISPLAY=docker-host:0` + `xhost` is **not** used. That pattern puts
container windows on the host desktop and still steals focus. The sidecar is
Unix-socket only (`network_mode: none`, `-nolisten tcp`). MIT-SHM is disabled
so the host JVM does not need `ipc: host`.
No success-path screenshots. Failure PNGs already come from
`SwtBotTestBase.captureLiveScreenshot`; Jenkins already archives
`**/screenshots/**`.
## Test plan
- [x] `tools/with-isolated-display.sh` with no args prints usage (exit 2)
- [x] Host `xvfb-run` path: `DISPLAY` becomes `:99`, `xdpyinfo` works, host
`xhost` on `:0` unchanged
- [x] Docker sidecar: `DISPLAY_NUM=143 docker compose -f
docker/ui-tests/compose.yaml up --build` creates `/tmp/.X11-unix/X143`, host
`xdpyinfo -display :143` works, socket gone after `down`
- [x] `./mvnw -Pskip-uitest -pl plugins/transforms/abort
-Dtest=AbortDialogTest test` → Tests run: 0
- [x] `./tools/with-isolated-display.sh ./mvnw -pl plugins/transforms/abort
-Dtest=AbortDialogTest test` → 2 tests pass, `_NET_ACTIVE_WINDOW` unchanged
- [x] Spotless check on touched modules
- [x] `./mvnw -N apache-rat:check` (Unapproved: 0)
- [ ] @hansva macOS review (see below)
Fixes #7968
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] Run `mvn clean install apache-rat:check` to make sure basic checks
pass. A more thorough check will be performed on your pull request
automatically.
- [x] If you have a group of commits related to the same change, please
squash your commits into one and force push your branch using `git rebase -i`.
- [x] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable.
To make clear that you license your contribution under the [Apache License
Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [x] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
---
## Review notes for @hansva (macOS)
Hans, this isolation is **Linux X11 / GTK only**. On your Mac the SWT
artifact is Cocoa (`swt-mac` + `-XstartOnFirstThread`). Please do **not** treat
a focus-free full `mvn clean install` as the acceptance test on OSX.
### What this will *not* do on a Mac
- `./tools/with-isolated-display.sh ./mvnw …` prints a warning and runs the
command on the interactive session. Cocoa windows will still pop up and steal
focus. That is expected.
- Binding a Linux Xvfb socket to the Mac host does **not** give a Mac JVM an
X11 display. Docker Desktop does not make `/tmp/.X11-unix` useful to Cocoa SWT.
- XQuartz + `DISPLAY=:0` / `xhost +` is **not** the review path. Even if
XQuartz is installed, Hop on macOS is still Cocoa, not `org.eclipse.swt.gtk`.
- `DISPLAY=docker-host:0` + `xhost` was considered and rejected: that is the
“show container GUIs on my desktop” pattern.
### What to review on OSX
1. **Script honesty**
```bash
./tools/with-isolated-display.sh true
```
You should see: `isolated X11 display is Linux-only (Darwin); SWT will
use the interactive session`.
2. **Skip profile (this is the Mac focus-free option)**
```bash
./mvnw -Pskip-uitest -pl plugins/transforms/abort -Dtest=AbortDialogTest
test
```
Expected: `Tests run: 0`. Then, if you want to confirm Cocoa still works:
```bash
./mvnw -pl plugins/transforms/abort -Dtest=AbortDialogTest test
```
Expected: 2 tests pass, and the Abort dialog **will** appear.
`-XstartOnFirstThread` should still be applied by `swt-mac`.
3. **Docker image/compose only** (optional)
```bash
docker compose -f docker/ui-tests/compose.yaml up --build
docker compose -f docker/ui-tests/compose.yaml down
```
Expected: image builds, container stays up. Do **not** expect
`DISPLAY=:99 ./mvnw …` on the Mac host to talk to that Xvfb. Running the Linux
GTK suite from a Mac host JVM is out of scope here.
4. **Docs** — please read the new paragraph in
`docs/hop-dev-manual/modules/ROOT/pages/setup-dev-environment.adoc` and say if
the macOS wording is clear enough for other Mac contributors.
Linux GTK isolation was already checked on my machine (`AbortDialogTest`
under the wrapper, focus window unchanged). Jenkins is unchanged and already
uses `xvfb-run`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]