Page MenuHomeDevCentral

Install PHPUnit as PHAR
ClosedPublic

Authored by dereckson on Feb 24 2023, 19:25.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 06:25
Unknown Object (File)
Tue, Dec 17, 05:27
Unknown Object (File)
Tue, Dec 10, 06:01
Unknown Object (File)
Sun, Dec 8, 16:47
Unknown Object (File)
Sat, Dec 7, 22:59
Unknown Object (File)
Fri, Dec 6, 14:18
Unknown Object (File)
Fri, Dec 6, 04:00
Unknown Object (File)
Thu, Dec 5, 07:41
Subscribers
None

Details

Summary

Packages can be out of date for PHPUnit.

Furthermore, this allows to use more easily the run-php-script
wrapper, so any version installed through Composer will be used
instead of the system one.

Test Plan

Tested on WindRiver

phpunit --version

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
phpunit
Build Status
Buildable 4453
Build 4720: arc lint + arc unit

Event Timeline

dereckson created this revision.

Version check

PHPUnit 9.6.3 by Sebastian Bergmann and contributors.

State check

windriver
$ salt-call --local state.sls_id phpunit roles/devserver/userland-software/dev
local:
----------
          ID: phpunit
    Function: cmd.run
        Name: curl --silent https://sebastian-bergmann.de/gpg.asc | gpg --import
wget -O /opt/phpunit.phar https://phar.phpunit.de/phpunit-9.phar
wget -O /opt/phpunit.phar.asc https://phar.phpunit.de/phpunit-9.phar.asc
cd /opt && gpg --verify ./phpunit.phar.asc
rm /opt/phpunit.phar.asc

      Result: True
     Comment: Command "curl --silent https://sebastian-bergmann.de/gpg.asc | gpg --import
              wget -O /opt/phpunit.phar https://phar.phpunit.de/phpunit-9.phar
              wget -O /opt/phpunit.phar.asc https://phar.phpunit.de/phpunit-9.phar.asc
              cd /opt && gpg --verify ./phpunit.phar.asc
              rm /opt/phpunit.phar.asc
              " run
     Started: 19:24:48.994102
    Duration: 4888.393 ms
     Changes:
              ----------
              pid:
                  77521
              retcode:
                  0
              stderr:
                  gpg: key 4AA394086372C20A: 452 signatures not checked due to missing keys
                  gpg: key 4AA394086372C20A: "Sebastian Bergmann <sb@sebastian-bergmann.de>" not changed
                  gpg: Total number processed: 1
                  gpg:              unchanged: 1
                  --2023-02-24 19:24:52--  https://phar.phpunit.de/phpunit-9.phar
                  Resolving phar.phpunit.de (phar.phpunit.de)... 172.67.71.75, 104.26.0.250, 104.26.1.250, ...
                  Connecting to phar.phpunit.de (phar.phpunit.de)|172.67.71.75|:443... connected.
                  HTTP request sent, awaiting response... 302 Found
                  Location: https://phar.phpunit.de/phpunit-9.6.3.phar [following]
                  --2023-02-24 19:24:53--  https://phar.phpunit.de/phpunit-9.6.3.phar
                  Reusing existing connection to phar.phpunit.de:443.
                  HTTP request sent, awaiting response... 200 OK
                  Length: 4616991 (4.4M) [application/octet-stream]
                  Saving to: ‘/opt/phpunit.phar’

                       0K .......... .......... .......... .......... ..........  1% 27.3M 0s
                      50K .......... .......... .......... .......... ..........  2% 9.59M 0s
[...]
                    4450K .......... .......... .......... .......... .......... 99% 89.3M 0s
                    4500K ........                                              100%  139M=0.4s

                  2023-02-24 19:24:53 (11.0 MB/s) - ‘/opt/phpunit.phar’ saved [4616991/4616991]

                  --2023-02-24 19:24:53--  https://phar.phpunit.de/phpunit-9.phar.asc
                  Resolving phar.phpunit.de (phar.phpunit.de)... 104.26.1.250, 172.67.71.75, 104.26.0.250, ...
                  Connecting to phar.phpunit.de (phar.phpunit.de)|104.26.1.250|:443... connected.
                  HTTP request sent, awaiting response... 302 Found
                  Location: https://phar.phpunit.de/phpunit-9.6.3.phar.asc [following]
                  --2023-02-24 19:24:53--  https://phar.phpunit.de/phpunit-9.6.3.phar.asc
                  Reusing existing connection to phar.phpunit.de:443.
                  HTTP request sent, awaiting response... 200 OK
                  Length: 870 [application/octet-stream]
                  Saving to: ‘/opt/phpunit.phar.asc’

                       0K                                                       100% 8.62M=0s

                  2023-02-24 19:24:53 (8.62 MB/s) - ‘/opt/phpunit.phar.asc’ saved [870/870]

                  gpg: assuming signed data in './phpunit.phar'
                  gpg: Signature made Sat Feb  4 13:37:41 2023 UTC
                  gpg:                using RSA key D8406D0D82947747293778314AA394086372C20A
                  gpg:                issuer "sb@sebastian-bergmann.de"
                  gpg: Good signature from "Sebastian Bergmann <sb@sebastian-bergmann.de>" [unknown]
                  gpg:                 aka "Sebastian Bergmann <sebastian@thephp.cc>" [unknown]
                  gpg:                 aka "Sebastian Bergmann <sebastian@phpunit.de>" [unknown]
                  gpg:                 aka "Sebastian Bergmann <sebastian@php.net>" [unknown]
                  gpg:                 aka "Sebastian Bergmann <sebastian.bergmann@thephp.cc>" [unknown]
                  gpg:                 aka "[jpeg image of size 40635]" [unknown]
                  gpg: WARNING: The key's User ID is not certified with a trusted signature!
                  gpg:          There is no indication that the signature belongs to the owner.
                  Primary key fingerprint: D840 6D0D 8294 7747 2937  7831 4AA3 9408 6372 C20A
              stdout:

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:   4.888 s

Idempotence check

windriver
$ salt-call --local state.sls_id phpunit roles/devserver/userland-software/dev
local:
----------
          ID: phpunit
    Function: cmd.run
        Name: curl --silent https://sebastian-bergmann.de/gpg.asc | gpg --import
wget -O /opt/phpunit.phar https://phar.phpunit.de/phpunit-9.phar
wget -O /opt/phpunit.phar.asc https://phar.phpunit.de/phpunit-9.phar.asc
cd /opt && gpg --verify ./phpunit.phar.asc
rm /opt/phpunit.phar.asc

      Result: True
     Comment: /opt/phpunit.phar exists
     Started: 19:25:01.476323
    Duration: 1741.12 ms
     Changes:

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:   1.741 s

Remove duplicate postgresql (badly rebased)

With xdebug 3.2.0 confirmed by T1728 / D2813, we can upgrade to 10.

It only affects the system version when none is installed through Composer.

Upgrade to PHPUnit 10: PHPUnit 10.0.11 by Sebastian Bergmann and contributors.

This revision is now accepted and ready to land.Mar 12 2023, 12:36
This revision was automatically updated to reflect the committed changes.