{"id":15925810,"url":"https://gitlab.com/interitty/nb-remote-phpunit","last_synced_at":"2025-03-24T14:32:32.633Z","repository":{"id":51385424,"uuid":"6028993","full_name":"interitty/nb-remote-phpunit","owner":"interitty","description":"Custom PHPUnit script that allows NetBeans to run tests on a remote host. Developed mainly to make working with Docker environments more convenient.","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":null,"default_branch":"main","last_synced_at":"2025-03-19T03:55:49.798Z","etag":null,"topics":["docker","interitty","netbeans","php","phpunit"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://gitlab.com/uploads/-/system/project/avatar/6028993/logo-nb-remote-phpunit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY","support":null}},"created_at":"2018-04-10T08:38:39.631Z","updated_at":"2024-12-07T10:51:14.360Z","dependencies_parsed_at":"2022-09-25T00:27:08.392Z","dependency_job_id":null,"html_url":"https://gitlab.com/interitty/nb-remote-phpunit","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/interitty%2Fnb-remote-phpunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/interitty%2Fnb-remote-phpunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/interitty%2Fnb-remote-phpunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/interitty%2Fnb-remote-phpunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/interitty","download_url":"https://gitlab.com/interitty/nb-remote-phpunit/-/archive/main/nb-remote-phpunit-main.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4518193,"owners_count":6881,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":["docker","interitty","netbeans","php","phpunit"],"created_at":"2024-10-06T22:04:34.038Z","updated_at":"2025-03-24T14:32:32.143Z","avatar_url":"https://gitlab.com/uploads/-/system/project/avatar/6028993/logo-nb-remote-phpunit.png","language":null,"readme":"# NetBeans remote PHPUnit runner #\n\nCustom PHPUnit script that allows NetBeans to run tests on a remote host. Developed mainly to make working with Docker environments more convenient.\n\n## Installation ##\n\nYou can simply place the [remote-phpunit.sh](src/remote-phpunit.sh) script wherever you want to on your local computer.\n\nAlternatively, you can install this [composer](https://getcomposer.org/) package as a requirement of your test stack.\n\n```bash\ncomposer require interitty/nb-remote-phpunit\n```\n\n## Usage ##\n\nActivate remote execution in [NetBeans](https://netbeans.org/) as follows:\n\n- Right-click your project and click \"`Properties`\".\n- Navigate to \"`Testing \u003e PHPUnit`\".\n- Check \"`Use Custom PHPUnit Script`\" and point \"`PHPUnit Script`\" to `SCRIPT_PATH/remote-phpunit.sh --docker-container=phpunit_1`, where `SCRIPT_PATH` is an absolute path to the folder, where is the [remote-phpunit.sh](src/remote-phpunit.sh) script situated.\n- Run tests as usual.\n\nWhen the script is a part of the project test stack, the `SCRIPT_PATH` will be `PROJECT_PATH/vendor/bin/`.\n\nMostly default docker container name `phpunit_1` is not the one you use. Don't forget to change this attribute.\n\n![NetBeans configuration example](assets/netbeans-configuration-example.png)\n\n## Settings ##\n\nThere are some more settings, you may need to make to suit your needs.\n\n| Script parameter             | Description                                                                                                                                                                                                                                                                          |\n| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `--base-dir=\"…\"`             | The base directory of all paths, which is also used for truncating output messages.                                                                                                                                                                                                  |\n| `--bootstrap \"…\"`            | The path to the `bootstrap.php` file. The default value is empty. Should be filled from NetBeans project settings \"`Use Bootstrap \u003e Bootstrap`\".                                                                                                                                     |\n| `--colors`, `--colors=\"…\"`   | Use colors in output (\"`never`\", \"`auto`\" or \"`always`\"). The default value is \"`auto`\". Can be changed by the argument of the script.                                                                                                                                               |\n| `--configuration \"…\"`        | Path to the `phpunit.xml` file. By default, the `phpunit.xml` file is searched in the current working directory or parent folders. Can be filled from NetBeans project settings \"`Use XML Configuration \u003e XML Configuration`\".                                                       |\n| `--coverage-clover \"…\"`      | Local path of the coverage report file. The default value is empty. Should be filled automatically, when the NetBeans asks for a [coverage report](https://netbeans.org/kb/docs/php/phpunit.html#code-coverage).                                                                     |\n| `--coverage-text`            | Generate code coverage report usable in the CI/CD pipelines                                                                                                                                                                                                                          |\n| `--docker-container=\"…\"`     | Name of the container, where should be remote PHPUnit executed. Default value is \"`phpunit_1`\". Can be changed by the argument of the script.                                                                                                                                        |\n| `--docker-path=\"…\"`          | The path for the local docker binary. Default value is \"`/usr/local/bin/docker`\". Can be changed by the argument of the script.                                                                                                                                                      |\n| `--fail-fast`                | Stop processing other tests when the first error happens.                                                                                                                                                                                                                            |\n| `--filter=\"…\"`               | Name of the specific test to test. Should be filled automatically, when the NetBeans [run a focused test method](https://blogs.oracle.com/geertjan/run-focused-test-method).                                                                                                         |\n| `--group \"…\"`                | Comma-separated list of test groups to test. The default value is empty. Should be filled automatically, when the NetBeans test [selected groups](https://netbeans.org/kb/docs/php/phpunit.html#test-groups).                                                                        |\n| `--list-groups`              | When present, the list of available test groups is printed. Should be filled automatically, when the NetBeans asks for [test groups](https://netbeans.org/kb/docs/php/phpunit.html#test-groups).                                                                                     |\n| `--log-junit \"…\"`            | Local path of the PHPUnit result file from where NetBeans parse the result. Should be filled automatically by the NetBeans.                                                                                                                                                          |\n| `--preserve-suite`           | By default, the script skips sending `NetBeansSuite.php` to the docker because it is difficult to get him there and is useless. If it is intentionally required, use this parameter.                                                                                                 |\n| `--remote-coverage-path=\"…\"` | Remote path of the coverage report file. The parent folder of the path should be in the [docker volume](https://docs.docker.com/storage/volumes/). The default value is \"`/tmp/junit/nb-phpunit-coverage.xml`\".                                                                      |\n| `--remote-junit-path=\"…\"`    | Remote path of the PHPUnit result file from where NetBeans parse the result. The parent folder of the path should be in the [docker volume](https://docs.docker.com/storage/volumes/). The default value is \"`/tmp/junit/nb-phpunit-log.xml`\".                                       |\n| `--remote-phpunit-path=\"…\"`  | Remote path of the PHPUnit binary. Default value is \"`/root/.composer/vendor/bin/phpunit`\". Can be changed by the argument of the script.                                                                                                                                            |\n| `--run=\"…\"`                  | Path of the file or folder of tests the PHPUnit runs on. Should be filled in automatically by the NetBeans.                                                                                                                                                                          |\n| `-v`, `--verbose`            | Show debugging information about executed commands and filled variables. Can be set by the argument of the script.                                                                                                                                                                   |\n| `--whitelist=\"…\"`            | Path of the files for checking the code coverage. The default value is empty. Should be filled automatically by the argument of the script. More info in [PhpUnit docs](https://phpunit.de/manual/current/en/code-coverage-analysis.html#code-coverage-analysis.whitelisting-files). |\n\n## Environment variables ##\n\nSome settings can also be set using an environment variable.\n\n| Environment variable | Description                                             |\n| -------------------- | ------------------------------------------------------- |\n| `CLICOLOR=1`         | Enable color output.                                    |\n| `DEBUG=1`            | Increase verbosity level to show also debug messages.   |\n| `VERBOSE=1`          | Increase verbosity level to show also warning messages. |\n\n## Limitations ##\n\nThis script requires the local path to the project to be the same as the path in the docker container. It does not provide any path conversion. The `/opt/srv` (*[opt](https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html), [srv](https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/srv.html)*) folder is perfectly suited for this purpose.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Finteritty%2Fnb-remote-phpunit","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Finteritty%2Fnb-remote-phpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Finteritty%2Fnb-remote-phpunit/lists"}