This commit is contained in:
Daniil Gentili 2023-10-23 22:21:43 +02:00
parent 2c09bdd409
commit b3fc233d62
5 changed files with 12 additions and 120 deletions

View File

@ -42,7 +42,7 @@ RUN true \
--libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.2 \ --libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.2 \
--sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man \ --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man \
--enable-debug --enable-address-sanitizer --disable-rpath --disable-static \ --enable-debug --enable-address-sanitizer --disable-rpath --disable-static \
--enable-filter --with-openssl \ --enable-filter --with-openssl --enable-mbstring \
--with-password-argon2=/usr --with-external-pcre --with-mhash=/usr --with-libxml \ --with-password-argon2=/usr --with-external-pcre --with-mhash=/usr --with-libxml \
--enable-session --with-sodium --with-zlib=/usr --with-zlib-dir=/usr \ --enable-session --with-sodium --with-zlib=/usr --with-zlib-dir=/usr \
--enable-pcntl --with-libedit=shared,/usr \ --enable-pcntl --with-libedit=shared,/usr \
@ -63,3 +63,5 @@ RUN php -r "readfile('https://getcomposer.org/installer');" | php \
ENV USE_ZEND_ALLOC=0 ENV USE_ZEND_ALLOC=0
ENV PSALM_ALLOW_XDEBUG=1 ENV PSALM_ALLOW_XDEBUG=1
WORKDIR /app

View File

@ -1,17 +0,0 @@
#!/bin/bash -e
cd /tmp
git clone https://github.com/vimeo/psalm
cd psalm
git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457
export PSALM_ALLOW_XDEBUG=1
composer i --ignore-platform-reqs
echo "About to run phpunit"
php vendor/bin/phpunit --debug tests/MagicMethodAnnotationTest.php
echo "OK, no bugs!"

View File

@ -1,80 +0,0 @@
<?php
require 'vendor/autoload.php';
use Infection\Configuration\Entry\Logs;
use Infection\Configuration\Entry\PhpUnit;
use Infection\Configuration\Entry\Source;
use Infection\Configuration\Schema\SchemaConfiguration;
use Infection\Configuration\Schema\SchemaConfigurationFactory;
use JsonSchema\Validator;
function test_it_can_create_a_config(
string $json,
): void {
$rawConfig = json_decode($json);
$validator = new Validator();
$validator->validate($rawConfig, json_decode('{
"$schema": "https://json-schema.org/draft-07/schema#",
"properties": {
"source": {"type": "string"}
}
}'));
$actual = (new SchemaConfigurationFactory())->create(
'/path/to/config',
$rawConfig
);
}
function provideRawConfig(): iterable
{
yield '[timeout] nominal' => [
<<<'JSON'
{
"timeout": 100,
"source": {
"directories": ["src"]
}
}
JSON
,
];
yield '[logs][text] nominal' => [
<<<'JSON'
{
"source": {
"directories": ["src"]
},
"logs": {
"text": "text.log"
}
}
JSON
,
];
yield '[logs][html] nominal' => [
<<<'JSON'
{
"source": {
"directories": ["src"]
},
"logs": {
"html": "report.html"
}
}
JSON
,
];
}
for ($x = 0; $x < 10000; $x++) {
foreach (provideRawConfig() as [$a]) {
test_it_can_create_a_config($a);
}
}

View File

@ -1,21 +0,0 @@
#!/bin/bash -e
#!/bin/bash -e
cd /tmp
git clone https://github.com/infection/infection
cd infection
git checkout fe7cbe78e5838608df42ec7688d353ef1d631fee
composer i --ignore-platform-reqs
echo "About to run the standalone test"
php /app/2_infection.php
echo "About to run the testsuite"
vendor/bin/phpunit
echo "OK, no bugs!"

View File

@ -2,6 +2,8 @@
cd /tmp cd /tmp
rm -rf psalm
git clone https://github.com/nicelocal/psalm -b rector_pass --depth 1 git clone https://github.com/nicelocal/psalm -b rector_pass --depth 1
cd psalm cd psalm
git checkout 9d3fee47afa90f3eb53043a26f01e587d2dd34e5 git checkout 9d3fee47afa90f3eb53043a26f01e587d2dd34e5
@ -12,6 +14,12 @@ composer i --ignore-platform-reqs
echo "About to run psalm" echo "About to run psalm"
./psalm --no-cache docker run -v $PWD:/app --rm --privileged -it asan_tests /usr/bin/php /app/psalm --no-cache
echo "About to run composer"
rm -rf vendor
docker run -v $PWD:/app --rm --privileged -it asan_tests composer update
echo "OK, no bugs!" echo "OK, no bugs!"