From a49fa65c70e6bebeb634cf32835021fc32b4346c Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Mon, 15 Jan 2024 15:23:19 +0100 Subject: [PATCH] test: cover newly introduced behavior in verification tests --- .github/workflows/mediawiki.verify.yml | 4 ++++ docker-compose/fake-api/index.php | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/mediawiki.verify.yml b/.github/workflows/mediawiki.verify.yml index ddae8d9ad..43ca51806 100644 --- a/.github/workflows/mediawiki.verify.yml +++ b/.github/workflows/mediawiki.verify.yml @@ -32,3 +32,7 @@ jobs: - run: curl -L -s -N "http://site2.localhost:8001/w/api.php" | grep -q "Main module" - run: curl -L -s -N "http://site2.localhost:8001/w/load.php" | grep -q "no modules were requested" - run: curl -L -s -N "http://site2.localhost:8001/w/rest.php" | grep -q "did not match any known handler" + + - run: curl -L -s -N "http://not-found.localhost:8001/wiki/Main_Page" | grep -q "It may never have existed" + + - run: curl -L -s -N "http://fail-with-500.localhost:8001/wiki/Main_Page" | grep -q "server error in the platform API" diff --git a/docker-compose/fake-api/index.php b/docker-compose/fake-api/index.php index 418d227a9..3b3631d81 100644 --- a/docker-compose/fake-api/index.php +++ b/docker-compose/fake-api/index.php @@ -16,8 +16,15 @@ // subdomain is 1 element $subdomain = $matches[1]; +if ( $subdomain === 'fail-with-500' ) { + http_response_code(500); + echo "Internal server error"; + die(1); +} + $file = __DIR__ . '/WikiInfo-'.$subdomain.'.json'; if ( !file_exists($file) ) { + http_response_code(404); echo 'Requested subdomain does not exist in test data'; die(1); }