From b3fc233d62b76a8e83536bc166bef02c3425b0b9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 23 Oct 2023 22:21:43 +0200 Subject: [PATCH] Fixes --- Dockerfile | 4 ++- bugs/1_psalm.sh | 17 ---------- bugs/2_infection.php | 80 -------------------------------------------- bugs/2_infection.sh | 21 ------------ bugs/3_psalm_new.sh | 10 +++++- 5 files changed, 12 insertions(+), 120 deletions(-) delete mode 100755 bugs/1_psalm.sh delete mode 100644 bugs/2_infection.php delete mode 100755 bugs/2_infection.sh diff --git a/Dockerfile b/Dockerfile index 55ebc58..e0e14c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN true \ --libdir=/usr/lib/php --libexecdir=/usr/lib/php --datadir=/usr/share/php/8.2 \ --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man \ --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 \ --enable-session --with-sodium --with-zlib=/usr --with-zlib-dir=/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 PSALM_ALLOW_XDEBUG=1 + +WORKDIR /app \ No newline at end of file diff --git a/bugs/1_psalm.sh b/bugs/1_psalm.sh deleted file mode 100755 index e92b42f..0000000 --- a/bugs/1_psalm.sh +++ /dev/null @@ -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!" \ No newline at end of file diff --git a/bugs/2_infection.php b/bugs/2_infection.php deleted file mode 100644 index fae7bae..0000000 --- a/bugs/2_infection.php +++ /dev/null @@ -1,80 +0,0 @@ -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); - } -} \ No newline at end of file diff --git a/bugs/2_infection.sh b/bugs/2_infection.sh deleted file mode 100755 index 297fd9c..0000000 --- a/bugs/2_infection.sh +++ /dev/null @@ -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!" \ No newline at end of file diff --git a/bugs/3_psalm_new.sh b/bugs/3_psalm_new.sh index 36fcd84..ce3a9d1 100755 --- a/bugs/3_psalm_new.sh +++ b/bugs/3_psalm_new.sh @@ -2,6 +2,8 @@ cd /tmp +rm -rf psalm + git clone https://github.com/nicelocal/psalm -b rector_pass --depth 1 cd psalm git checkout 9d3fee47afa90f3eb53043a26f01e587d2dd34e5 @@ -12,6 +14,12 @@ composer i --ignore-platform-reqs 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!" \ No newline at end of file