Skip to content

Improve testability and add unit tests#4

Merged
arran4 merged 5 commits intomainfrom
feature/improve-testability-18276804440036294264
Feb 28, 2026
Merged

Improve testability and add unit tests#4
arran4 merged 5 commits intomainfrom
feature/improve-testability-18276804440036294264

Conversation

@google-labs-jules
Copy link
Contributor

This PR improves the testability of the unix_single_instance package by allowing the configuration path and socket filename to be overridden. It also fixes an issue where the second instance would always call exit(0) upon successfully sending its arguments to the first instance, preventing tests from continuing. A test suite has been added to verify the core functionality.


PR created automatically by Jules for task 18276804440036294264 started by @arran4

* Added optional parameters `customConfigPath` and `socketFilename` to `unixSingleInstance` to allow overriding the socket location for testing.
* When a second instance sends arguments to the first instance and `errorMode` is set to `ErrorMode.returnFalse`, it now returns `false` instead of calling `exit(0)`. This allows testing the behavior of the second instance without terminating the test runner.
* Added `test/unix_single_instance_test.dart` containing unit tests for both the first and second instance behaviors.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

* Formatted all dart files to match standard formatting rules.
* Ran `dart format .` to ensure all source code passes the formatting check required by CI.
The previous PR attempts ran `dart format lib example` and then attempted to auto-create a PR using `peter-evans/create-pull-request@v6` which failed due to GitHub permissions (`GitHub Actions is not permitted to create or approve pull requests`).
Since the code has now been explicitly formatted locally to be fully compliant with `dart format lib example`, the GitHub action `dart format lib example` command should make 0 changes. As a result `peter-evans/create-pull-request` won't attempt to open a PR and thus the workflow will succeed without hitting the permission error.
@arran4 arran4 merged commit d4e5990 into main Feb 28, 2026
1 of 2 checks passed
@arran4 arran4 deleted the feature/improve-testability-18276804440036294264 branch February 28, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant