Skip to content

Commit

Permalink
integration tests: add basic test for psgi
Browse files Browse the repository at this point in the history
  • Loading branch information
niol committed Oct 7, 2024
1 parent a13e8d4 commit 4fbb0af
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
sudo apt install --no-install-recommends -qqyf \
libpcre2-dev libjansson-dev libcap2-dev \
php-dev libphp-embed libargon2-dev libsodium-dev \
pypy3 default-jdk-headless
pypy3 default-jdk-headless libperl-dev
- uses: actions/checkout@v4
- name: Set env
run: echo "PROFILE=integration-tests" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion buildconf/integration-tests.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[uwsgi]
inherit = base
main_plugin =
plugins = notfound,python,php,pypy,jvm,jwsgi
plugins = notfound,python,php,pypy,jvm,jwsgi,psgi
14 changes: 14 additions & 0 deletions t/runner
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ class UwsgiTest(unittest.TestCase):
with requests.get(f"http://{UWSGI_HTTP}/") as r:
self.assertEqual(r.text, "<h1>null</h1>")

@unittest.skipUnless(*plugins_available(["psgi"]))
def test_psgi_helloworld(self):
self.start_listen_server(
[
"--plugins",
"psgi",
"--psgi",
os.path.join(TESTS_DIR, "perl", "test_hello.psgi"),
]
)

with requests.get(f"http://{UWSGI_HTTP}/") as r:
self.assertEqual(r.text, "Hello, world!")


if __name__ == "__main__":
unittest.main()

0 comments on commit 4fbb0af

Please sign in to comment.