From 2c401867119599641d1cdb574c6a8a4d69319750 Mon Sep 17 00:00:00 2001 From: Jack Worman Date: Sat, 15 Oct 2022 21:16:45 -0500 Subject: [PATCH] Paratest --- .github/workflows/ci.yml | 18 ++++++++++-------- README.md | 6 +----- build/psalm_baseline.xml | 20 ++++---------------- composer.json | 22 +++++++++++++--------- 4 files changed, 28 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03683f97..f6bf015a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,14 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - tools: php-parallel-lint/php-parallel-lint:1 + - name: Composer Install + run: composer install --classmap-authoritative --no-interaction --no-cache - name: Lint - run: parallel-lint --show-deprecated build phpseclib tests + run: vendor/bin/parallel-lint --show-deprecated build phpseclib tests strategy: fail-fast: false matrix: - php-version: ['8.1'] + php-version: ['8.1', '8.2'] quality_tools: name: Quality Tools timeout-minutes: 5 @@ -30,15 +31,16 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.1' - tools: squizlabs/php_codesniffer:3, friendsofphp/php-cs-fixer:3, vimeo/psalm:4 - name: Composer Install run: composer install --classmap-authoritative --no-interaction --no-cache - name: PHP_CodeSniffer - run: phpcs --standard=build/php_codesniffer.xml + run: vendor/bin/phpcs --standard=build/php_codesniffer.xml - name: PHP CS Fixer - run: php-cs-fixer fix --config=build/php-cs-fixer.php --diff --dry-run --using-cache=no + run: vendor/bin/php-cs-fixer fix --config=build/php-cs-fixer.php --diff --dry-run --using-cache=no - name: Psalm - run: psalm --config=build/psalm.xml --no-cache --long-progress --report-show-info=false + run: vendor/bin/psalm --config=build/psalm.xml --no-cache --long-progress --report-show-info=false + strategy: + fail-fast: false tests: name: Tests timeout-minutes: 10 @@ -75,7 +77,7 @@ jobs: echo "PHPSECLIB_SSH_HOME=/home/phpseclib" >> $GITHUB_ENV echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV - name: PHPUnit - run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml + run: vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner strategy: fail-fast: false matrix: diff --git a/README.md b/README.md index c78f1965..e92d4ffa 100644 --- a/README.md +++ b/README.md @@ -88,11 +88,7 @@ Special Thanks to our $50+ sponsors!: 5. Run continuous integration checks: ```sh - composer global require php:^8.1 squizlabs/php_codesniffer friendsofphp/php-cs-fixer vimeo/psalm - phpcs --standard=build/php_codesniffer.xml - php-cs-fixer fix --config=build/php-cs-fixer.php --diff --dry-run --using-cache=no - psalm --config=build/psalm.xml --no-cache --long-progress --report-show-info=false --output-format=text - vendor/bin/phpunit --verbose --configuration tests/phpunit.xml + composer run-script all-quality-tools ``` 6. Send us a Pull Request diff --git a/build/psalm_baseline.xml b/build/psalm_baseline.xml index 997f3e58..354cb36f 100644 --- a/build/psalm_baseline.xml +++ b/build/psalm_baseline.xml @@ -1,5 +1,5 @@ - + $var @@ -284,11 +284,7 @@ $sb_0[$r >> 24 & 0xff] self::$parray[$i] - - $sha2pass - $sha2pass - $sha2salt - $sha2salt + unpack('C*', $this->key) unpack('N*', $data = $this->encryptBlock($data)) unpack('N*', $data = $this->encryptBlock($data)) @@ -6507,14 +6503,10 @@ is_string($this->key) is_string($this->nonce) - $initial[$i] $k[$i] - - string - $matches[2] @@ -6871,14 +6863,12 @@ $y->toBytes() - + $m[$i] $m[$i] $m[$i] $m[$i] $m[$i] ?? '' - $output - $output pack('N4', 0, $index, 0, 1) @@ -15291,9 +15281,7 @@ $length $temp - - $address - $address + $agent_data_bytes $agent_reply_bytes $agent_reply_data diff --git a/composer.json b/composer.json index 9b94c1b6..c47d48c1 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,11 @@ }, "require-dev": { "ext-xml": "*", - "phpunit/phpunit": "*" + "brianium/paratest": "^6.6", + "friendsofphp/php-cs-fixer": "^3.12", + "php-parallel-lint/php-parallel-lint": "^1.3", + "squizlabs/php_codesniffer": "^3.7", + "vimeo/psalm": "^4.29" }, "suggest": { "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", @@ -87,14 +91,14 @@ "sort-packages": true }, "scripts": { - "lint": "parallel-lint --show-deprecated build phpseclib tests", - "php_codesniffer": "phpcs --standard=build/php_codesniffer.xml", - "php_codesniffer-fix": "phpcbf --standard=build/php_codesniffer.xml", - "php-cs-fixer": "php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no --dry-run", - "php-cs-fixer-fix": "php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no", - "psalm": "psalm --config=build/psalm.xml --no-cache --long-progress", - "psalm-set-baseline": "psalm --config=build/psalm.xml --no-cache --long-progress --set-baseline=psalm_baseline.xml", - "test": "vendor/bin/phpunit --configuration tests/phpunit.xml", + "lint": "vendor/bin/parallel-lint --show-deprecated build phpseclib tests", + "php_codesniffer": "vendor/bin/phpcs --standard=build/php_codesniffer.xml", + "php_codesniffer-fix": "vendor/bin/phpcbf --standard=build/php_codesniffer.xml", + "php-cs-fixer": "vendor/bin/php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no --dry-run", + "php-cs-fixer-fix": "vendor/bin/php-cs-fixer fix --config=build/php-cs-fixer.php --diff --using-cache=no", + "psalm": "vendor/bin/psalm --config=build/psalm.xml --no-cache --long-progress --threads=4", + "psalm-set-baseline": "vendor/bin/psalm --config=build/psalm.xml --no-cache --long-progress --set-baseline=psalm_baseline.xml --threads=4", + "test": "vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner", "all-quality-tools": [ "@lint", "@phpcs",