From b9f9de56c9aa4e9fb3a5f77add7701086b5919ea Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 14:48:11 +0100 Subject: [PATCH 01/14] allow testing on custom host/port --- tests/CrawlerTest.php | 172 ++++++++++++++++++++++-------------------- 1 file changed, 92 insertions(+), 80 deletions(-) diff --git a/tests/CrawlerTest.php b/tests/CrawlerTest.php index b31b37d..9ce086f 100644 --- a/tests/CrawlerTest.php +++ b/tests/CrawlerTest.php @@ -6,188 +6,200 @@ use GuzzleHttp\RequestOptions; class CrawlerTest extends TestCase{ + private $url='http://localhost:8080'; + + public function __construct(){ + parent::__construct(); + if(getenv('URL')){ + $this->url=getenv('URL'); + } + echo $this->url; + + } + public function testFullSite(){ + echo $this->url; $crawler=new Crawler([RequestOptions::CONNECT_TIMEOUT => 3, RequestOptions::TIMEOUT => 3]); - $crawler->crawl('http://localhost:8080/'); + $crawler->crawl($this->url); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ 'http://example.com/' => ['code' => 200], - 'http://localhost:8080/deeplink1' => ['code' => 200], - 'http://localhost:8080/deeplink2' => ['code' => 200], - 'http://localhost:8080/deeplink3' => ['code' => 200], - 'http://localhost:8080/externalLink' => ['code' => 200], - 'http://localhost:8080/found' => ['code' => 200], - 'http://localhost:8080/interlinked1' => ['code' => 200], - 'http://localhost:8080/interlinked2' => ['code' => 200], - 'http://localhost:8080/interlinked3' => ['code' => 200], - 'http://localhost:8080/internalServerError' => ['code' => 500], - 'http://localhost:8080/invalidStatusCode' => ['code' => '---'], - 'http://localhost:8080/notFound' => ['code' => 404], - 'http://localhost:8080/redirect1' => ['code' => 302], - 'http://localhost:8080/redirect2' => ['code' => 302], - 'http://localhost:8080/redirectLoop' => ['code' => '---'], - 'http://localhost:8080/redirectToFound' => ['code' => 302 ], - 'http://localhost:8080/redirectToNotFound' => ['code' => 302 ], - 'http://localhost:8080/redirectToRedirectToNotFound' => ['code' => 302], - 'http://localhost:8080/timeout' => ['code' => '---'], - 'http://localhost:8080/twoRedirectsToSameLocation' => ['code' => 200], + $this->url.'/deeplink1' => ['code' => 200], + $this->url.'/deeplink2' => ['code' => 200], + $this->url.'/deeplink3' => ['code' => 200], + $this->url.'/externalLink' => ['code' => 200], + $this->url.'/found' => ['code' => 200], + $this->url.'/interlinked1' => ['code' => 200], + $this->url.'/interlinked2' => ['code' => 200], + $this->url.'/interlinked3' => ['code' => 200], + $this->url.'/internalServerError' => ['code' => 500], + $this->url.'/invalidStatusCode' => ['code' => '---'], + $this->url.'/notFound' => ['code' => 404], + $this->url.'/redirect1' => ['code' => 302], + $this->url.'/redirect2' => ['code' => 302], + $this->url.'/redirectLoop' => ['code' => '---'], + $this->url.'/redirectToFound' => ['code' => 302 ], + $this->url.'/redirectToNotFound' => ['code' => 302 ], + $this->url.'/redirectToRedirectToNotFound' => ['code' => 302], + $this->url.'/timeout' => ['code' => '---'], + $this->url.'/twoRedirectsToSameLocation' => ['code' => 200], ], print_r($sitemap,true)); } public function testFound(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/found'); + $crawler->crawl($this->url.'/found'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/found' => ['code' => 200], + $this->url.'/found' => ['code' => 200], ], print_r($sitemap,true)); } public function testNotFound(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/notFound'); + $crawler->crawl($this->url.'/notFound'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/notFound' => ['code' => 404], + $this->url.'/notFound' => ['code' => 404], ], print_r($sitemap,true)); } public function testExternalLink(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/externalLink'); + $crawler->crawl($this->url.'/externalLink'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/externalLink' => ['code' => 200], + $this->url.'/externalLink' => ['code' => 200], 'http://example.com/' => ['code' => 200], ], print_r($sitemap,true)); } public function testDeeplink(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/deeplink1'); + $crawler->crawl($this->url.'/deeplink1'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/deeplink1' => ['code' => 200], - 'http://localhost:8080/deeplink2' => ['code' => 200], - 'http://localhost:8080/deeplink3' => ['code' => 200], + $this->url.'/deeplink1' => ['code' => 200], + $this->url.'/deeplink2' => ['code' => 200], + $this->url.'/deeplink3' => ['code' => 200], ], print_r($sitemap,true)); } public function testInterlinked(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/interlinked1'); - $crawler->crawl('http://localhost:8080/interlinked4'); //this ensures the order or results for the URL tracking test PART2 + $crawler->crawl($this->url.'/interlinked1'); + $crawler->crawl($this->url.'/interlinked4'); //this ensures the order or results for the URL tracking test PART2 $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/interlinked1' => ['code' => 200 , 'foundOn' => [ - 'http://localhost:8080/interlinked1' => 1, - 'http://localhost:8080/interlinked2' => 1, - 'http://localhost:8080/interlinked3' => 1, - 'http://localhost:8080/interlinked4' => 1, + $this->url.'/interlinked1' => ['code' => 200 , 'foundOn' => [ + $this->url.'/interlinked1' => 1, + $this->url.'/interlinked2' => 1, + $this->url.'/interlinked3' => 1, + $this->url.'/interlinked4' => 1, ]], - 'http://localhost:8080/interlinked2' => ['code' => 200 , 'foundOn' => [ - 'http://localhost:8080/interlinked1' => 1, - 'http://localhost:8080/interlinked2' => 1, - 'http://localhost:8080/interlinked3' => 1, - 'http://localhost:8080/interlinked4' => 1, + $this->url.'/interlinked2' => ['code' => 200 , 'foundOn' => [ + $this->url.'/interlinked1' => 1, + $this->url.'/interlinked2' => 1, + $this->url.'/interlinked3' => 1, + $this->url.'/interlinked4' => 1, ]], - 'http://localhost:8080/interlinked3' => ['code' => 200 , 'foundOn' => [ - 'http://localhost:8080/interlinked1' => 1, - 'http://localhost:8080/interlinked2' => 1, - 'http://localhost:8080/interlinked3' => 1, - 'http://localhost:8080/interlinked4' => 1, + $this->url.'/interlinked3' => ['code' => 200 , 'foundOn' => [ + $this->url.'/interlinked1' => 1, + $this->url.'/interlinked2' => 1, + $this->url.'/interlinked3' => 1, + $this->url.'/interlinked4' => 1, ]], - 'http://localhost:8080/found' => ['code' => 200 , 'foundOn' => [ - 'http://localhost:8080/interlinked1' => 1, - 'http://localhost:8080/interlinked2' => 1, - 'http://localhost:8080/interlinked3' => 1, - 'http://localhost:8080/interlinked4' => 1, + $this->url.'/found' => ['code' => 200 , 'foundOn' => [ + $this->url.'/interlinked1' => 1, + $this->url.'/interlinked2' => 1, + $this->url.'/interlinked3' => 1, + $this->url.'/interlinked4' => 1, ]], - 'http://localhost:8080/redirectToFound' => ['code' => 302 , 'foundOn' => [ - 'http://localhost:8080/interlinked1' => 1, - 'http://localhost:8080/interlinked2' => 1, - 'http://localhost:8080/interlinked3' => 1, - 'http://localhost:8080/interlinked4' => 1, + $this->url.'/redirectToFound' => ['code' => 302 , 'foundOn' => [ + $this->url.'/interlinked1' => 1, + $this->url.'/interlinked2' => 1, + $this->url.'/interlinked3' => 1, + $this->url.'/interlinked4' => 1, ]], ], print_r($sitemap,true)); } public function testRedirectToFound(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/redirectToFound'); + $crawler->crawl($this->url.'/redirectToFound'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/redirectToFound' => ['code' => 302], - 'http://localhost:8080/found' => ['code' => 200 ], + $this->url.'/redirectToFound' => ['code' => 302], + $this->url.'/found' => ['code' => 200 ], ], print_r($sitemap,true)); } public function testRedirectToNotFound(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/redirectToNotFound'); + $crawler->crawl($this->url.'/redirectToNotFound'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/redirectToNotFound' => ['code' => 302], - 'http://localhost:8080/notFound' => ['code' => 404 ], + $this->url.'/redirectToNotFound' => ['code' => 302], + $this->url.'/notFound' => ['code' => 404 ], ], print_r($sitemap,true)); } public function testRedirectToRedirectToNotFound(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/redirectToRedirectToNotFound'); + $crawler->crawl($this->url.'/redirectToRedirectToNotFound'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/redirectToRedirectToNotFound' => ['code' => 302], - 'http://localhost:8080/redirectToNotFound' => ['code' => 302], - 'http://localhost:8080/notFound' => ['code' => 404], + $this->url.'/redirectToRedirectToNotFound' => ['code' => 302], + $this->url.'/redirectToNotFound' => ['code' => 302], + $this->url.'/notFound' => ['code' => 404], ], print_r($sitemap,true)); } public function testTwoRedirectsToSameLocation(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/twoRedirectsToSameLocation'); + $crawler->crawl($this->url.'/twoRedirectsToSameLocation'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/twoRedirectsToSameLocation' => ['code' => 200], - 'http://localhost:8080/redirect1' => ['code' => 302], - 'http://localhost:8080/redirect2' => ['code' => 302], - 'http://localhost:8080/found' => ['code' => 200], + $this->url.'/twoRedirectsToSameLocation' => ['code' => 200], + $this->url.'/redirect1' => ['code' => 302], + $this->url.'/redirect2' => ['code' => 302], + $this->url.'/found' => ['code' => 200], ], print_r($sitemap,true)); } public function testTimeout(){ $crawler=new Crawler([RequestOptions::CONNECT_TIMEOUT => 3, RequestOptions::TIMEOUT => 3]); - $crawler->crawl('http://localhost:8080/timeout'); + $crawler->crawl($this->url.'/timeout'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/timeout' => ['code' => '---'], + $this->url.'/timeout' => ['code' => '---'], ], print_r($sitemap,true)); } public function testRedirectLoop(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/redirectLoop'); + $crawler->crawl($this->url.'/redirectLoop'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/redirectLoop' => ['code' => '---'], + $this->url.'/redirectLoop' => ['code' => '---'], ], print_r($sitemap,true)); } public function testInternalServerError(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/internalServerError'); + $crawler->crawl($this->url.'/internalServerError'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/internalServerError' => ['code' => 500], + $this->url.'/internalServerError' => ['code' => 500], ], print_r($sitemap,true)); } public function testInvalidStatusCode(){ $crawler=new Crawler(); - $crawler->crawl('http://localhost:8080/invalidStatusCode'); + $crawler->crawl($this->url.'/invalidStatusCode'); $sitemap=$crawler->getResults(); $this->assertTreeContains($sitemap,[ - 'http://localhost:8080/invalidStatusCode' => ['code' => '---'], + $this->url.'/invalidStatusCode' => ['code' => '---'], ], print_r($sitemap,true)); } -- 2.30.2 From aec7cf7bc28864a4ccfb55516db05f4781944aa2 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 14:49:25 +0100 Subject: [PATCH 02/14] init drone file --- .drone.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9f0706f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +kind: pipeline +type: docker +name: testsuite + +steps: + +- name: composer install + image: chialab/php + commands: + - composer install + volumes: + - name: composer-cache + path: /root/.composer/cache/ + +- name: wait for test server + image: alpine + commands: + - echo "Waiting for server to launch on testserver:8080..." + - while ! nc -z testserver 8080; do sleep 0.1 ; done + - echo "Ready!" + +- name: run tests + image: chialab/php + environment: + - URL=testserver:8080 + commands: + - sleep 10 + - vendor/bin/phpunit tests + +services : + +- name: testserver + image: node + detach: true + commands: + - cd tests/server/ + - npm install + - node server.js -- 2.30.2 From 3b6852f2c4d620836569383debdc3956eda8a9eb Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 14:51:34 +0100 Subject: [PATCH 03/14] fix drone? --- .drone.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9f0706f..5a2b8a9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,34 +5,34 @@ name: testsuite steps: - name: composer install - image: chialab/php - commands: - - composer install - volumes: - - name: composer-cache - path: /root/.composer/cache/ + image: chialab/php + commands: + - composer install + volumes: + - name: composer-cache + path: /root/.composer/cache/ - name: wait for test server - image: alpine - commands: - - echo "Waiting for server to launch on testserver:8080..." - - while ! nc -z testserver 8080; do sleep 0.1 ; done - - echo "Ready!" + image: alpine + commands: + - echo "Waiting for server to launch on testserver:8080..." + - while ! nc -z testserver 8080; do sleep 0.1 ; done + - echo "Ready!" - name: run tests - image: chialab/php - environment: + image: chialab/php + environment: - URL=testserver:8080 - commands: - - sleep 10 - - vendor/bin/phpunit tests + commands: + - sleep 10 + - vendor/bin/phpunit tests -services : +services: - name: testserver - image: node - detach: true - commands: - - cd tests/server/ - - npm install - - node server.js + image: node + detach: true + commands: + - cd tests/server/ + - npm install + - node server.js -- 2.30.2 From 4021c7bb796dc6abfaad94e559d000b9d39abf2c Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 14:57:39 +0100 Subject: [PATCH 04/14] fix --- .drone.yml | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5a2b8a9..c65df4a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,34 +5,34 @@ name: testsuite steps: - name: composer install - image: chialab/php - commands: - - composer install - volumes: - - name: composer-cache - path: /root/.composer/cache/ + image: chialab/php + commands: + - composer install + volumes: + - name: composer-cache + path: /root/.composer/cache/ - name: wait for test server - image: alpine - commands: - - echo "Waiting for server to launch on testserver:8080..." - - while ! nc -z testserver 8080; do sleep 0.1 ; done - - echo "Ready!" + image: alpine + commands: + - echo "Waiting for server to launch on testserver:8080..." + - while ! nc -z testserver 8080; do sleep 0.1 ; done + - echo "Ready!" - name: run tests - image: chialab/php - environment: - - URL=testserver:8080 - commands: - - sleep 10 - - vendor/bin/phpunit tests + image: chialab/php + environment: + - URL=testserver:8080 + commands: + - sleep 10 + - vendor/bin/phpunit tests services: - name: testserver - image: node - detach: true - commands: - - cd tests/server/ - - npm install - - node server.js + image: node + detach: true + commands: + - cd tests/server/ + - npm install + - node server.js -- 2.30.2 From 5d3032b8dcf6ecdf4ed0641b6efb313c310876ef Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 14:58:23 +0100 Subject: [PATCH 05/14] fix --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c65df4a..5b840e7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: - name: run tests image: chialab/php environment: - - URL=testserver:8080 + - URL: testserver:8080 commands: - sleep 10 - vendor/bin/phpunit tests -- 2.30.2 From f7f995fd3d24f593cd1d5333d0e40614fe83f9bb Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:00:11 +0100 Subject: [PATCH 06/14] fix --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5b840e7..093dca2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: - name: run tests image: chialab/php environment: - - URL: testserver:8080 + - "URL=testserver:8080" commands: - sleep 10 - vendor/bin/phpunit tests -- 2.30.2 From aac74afe72c50c4c157e30175fe0c21f8b4362af Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:01:50 +0100 Subject: [PATCH 07/14] fix --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 093dca2..7a8c9fc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,7 @@ steps: - name: run tests image: chialab/php environment: - - "URL=testserver:8080" + - "URL=testserver:8080" commands: - sleep 10 - vendor/bin/phpunit tests -- 2.30.2 From 290eb891924f95ec2757733e6691b03b142e8d1c Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:04:15 +0100 Subject: [PATCH 08/14] fix --- .drone.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7a8c9fc..735fa83 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,11 +21,9 @@ steps: - name: run tests image: chialab/php - environment: - - "URL=testserver:8080" commands: - sleep 10 - - vendor/bin/phpunit tests + - URL=testserver:8080 vendor/bin/phpunit tests services: -- 2.30.2 From f2fc6cf3bdd8060dc3791906ff562acc937da49c Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:06:22 +0100 Subject: [PATCH 09/14] remove debug --- tests/CrawlerTest.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/CrawlerTest.php b/tests/CrawlerTest.php index 9ce086f..b42f3bc 100644 --- a/tests/CrawlerTest.php +++ b/tests/CrawlerTest.php @@ -13,12 +13,9 @@ class CrawlerTest extends TestCase{ if(getenv('URL')){ $this->url=getenv('URL'); } - echo $this->url; - } public function testFullSite(){ - echo $this->url; $crawler=new Crawler([RequestOptions::CONNECT_TIMEOUT => 3, RequestOptions::TIMEOUT => 3]); $crawler->crawl($this->url); $sitemap=$crawler->getResults(); -- 2.30.2 From 269b95c583258f6ad3612b3be3a002cf9ab7140c Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:07:17 +0100 Subject: [PATCH 10/14] fix --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 735fa83..dd6bf52 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,7 +23,7 @@ steps: image: chialab/php commands: - sleep 10 - - URL=testserver:8080 vendor/bin/phpunit tests + - URL=http://testserver:8080 vendor/bin/phpunit tests services: -- 2.30.2 From 5af2db0df9820801179d6714808211a24e45f328 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:07:52 +0100 Subject: [PATCH 11/14] remove sleep --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index dd6bf52..2f0aeae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,7 +22,6 @@ steps: - name: run tests image: chialab/php commands: - - sleep 10 - URL=http://testserver:8080 vendor/bin/phpunit tests services: -- 2.30.2 From 3a699368511ca30f0585668d950d7efd36494d08 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:10:04 +0100 Subject: [PATCH 12/14] test insddenting --- .drone.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2f0aeae..3edc096 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,31 +5,31 @@ name: testsuite steps: - name: composer install - image: chialab/php - commands: - - composer install - volumes: - - name: composer-cache - path: /root/.composer/cache/ + image: chialab/php + commands: + - composer install + volumes: + - name: composer-cache + path: /root/.composer/cache/ - name: wait for test server - image: alpine - commands: - - echo "Waiting for server to launch on testserver:8080..." - - while ! nc -z testserver 8080; do sleep 0.1 ; done - - echo "Ready!" + image: alpine + commands: + - echo "Waiting for server to launch on testserver:8080..." + - while ! nc -z testserver 8080; do sleep 0.1 ; done + - echo "Ready!" - name: run tests - image: chialab/php - commands: - - URL=http://testserver:8080 vendor/bin/phpunit tests + image: chialab/php + commands: + - URL=http://testserver:8080 vendor/bin/phpunit tests services: - name: testserver - image: node - detach: true - commands: - - cd tests/server/ - - npm install - - node server.js + image: node + detach: true + commands: + - cd tests/server/ + - npm install + - node server.js -- 2.30.2 From 943d6c89e63d29a672c8525cd0ddecdd1ef735b2 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:10:46 +0100 Subject: [PATCH 13/14] fix --- .drone.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3edc096..2f0aeae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,31 +5,31 @@ name: testsuite steps: - name: composer install - image: chialab/php - commands: - - composer install - volumes: - - name: composer-cache - path: /root/.composer/cache/ + image: chialab/php + commands: + - composer install + volumes: + - name: composer-cache + path: /root/.composer/cache/ - name: wait for test server - image: alpine - commands: - - echo "Waiting for server to launch on testserver:8080..." - - while ! nc -z testserver 8080; do sleep 0.1 ; done - - echo "Ready!" + image: alpine + commands: + - echo "Waiting for server to launch on testserver:8080..." + - while ! nc -z testserver 8080; do sleep 0.1 ; done + - echo "Ready!" - name: run tests - image: chialab/php - commands: - - URL=http://testserver:8080 vendor/bin/phpunit tests + image: chialab/php + commands: + - URL=http://testserver:8080 vendor/bin/phpunit tests services: - name: testserver - image: node - detach: true - commands: - - cd tests/server/ - - npm install - - node server.js + image: node + detach: true + commands: + - cd tests/server/ + - npm install + - node server.js -- 2.30.2 From e53dba22b35ad6e12482c045b4b4842adb284b75 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 30 Sep 2020 15:13:41 +0100 Subject: [PATCH 14/14] tidy --- README.md | 3 ++- tests/server/start_server.sh | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100755 tests/server/start_server.sh diff --git a/README.md b/README.md index 4246ac3..7cb3106 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ Start the test server, will listen on localhost:8080 ```plain cd tests/server -./start_server.sh +npm install +node server.js ``` Run the tests: diff --git a/tests/server/start_server.sh b/tests/server/start_server.sh deleted file mode 100755 index 6f25d34..0000000 --- a/tests/server/start_server.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -npm install - -if [ -z ${TRAVIS_JOB_ID} ]; then - # not running under travis, stay in foreground until stopped - node server.js -else - cd tests/server - - # running under travis, daemonize - (node server.js &) || /bin/true -fi -- 2.30.2