Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix functional test setup with nginx (trivis-ci) #75

Merged
merged 1 commit into from

2 participants

@asm89

The issue with the Content-Type header is fixed now, but the tests are failing on travis because of the nginx configuration (and version). After this PR everything should be fine again:
Build Status

@kriswallsmith

I'm curious why this works. Would you mind explaining your change in a bit more detail?

@asm89 asm89 commented on the diff
test/nginx.conf.dist
@@ -32,7 +32,8 @@ http {
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
+ fastcgi_param CONTENT_TYPE $content_type if_not_empty;
@asm89
asm89 added a note

In the old config the CONTENT_TYPE directive would always be set even if it was empty. In the test case you adapted you checked with assertArrayNotHasKey(), which would fail because fastcgi would always set this param. Starting from nginx 1.1.1 the if_not_empty directive was added.

The default nginx install that ships with ubuntu is 1.0.5, that's why I add the nginx ppa and install from that source instead (@ .travis.yml).

Hope it is more clear now! :)

@kriswallsmith Owner

Cool, thanks for humoring me :)

@asm89
asm89 added a note

Glad I was able to and thanks for all the great libs. :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@kriswallsmith kriswallsmith merged commit 1bab480 into kriswallsmith:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2012
  1. @asm89
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +3 −1 .travis.yml
  2. +2 −1  test/nginx.conf.dist
View
4 .travis.yml
@@ -4,8 +4,10 @@ php:
- 5.3
- 5.4
+before_install:
+ - echo "" | sudo add-apt-repository ppa:nginx/stable && sudo apt-get update && sudo apt-get -qq install nginx > /dev/null 2>&1
+
before_script:
- - sudo apt-get -qq install nginx > /dev/null 2>&1
- php-cgi -b 127.0.0.1:9000 &
- nginx -v && sudo nginx -c nginx.conf.dist -p test
- export TEST_SERVER="http://localhost:8080/server.php"
View
3  test/nginx.conf.dist
@@ -32,7 +32,8 @@ http {
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
+ fastcgi_param CONTENT_TYPE $content_type if_not_empty;
@asm89
asm89 added a note

In the old config the CONTENT_TYPE directive would always be set even if it was empty. In the test case you adapted you checked with assertArrayNotHasKey(), which would fail because fastcgi would always set this param. Starting from nginx 1.1.1 the if_not_empty directive was added.

The default nginx install that ships with ubuntu is 1.0.5, that's why I add the nginx ppa and install from that source instead (@ .travis.yml).

Hope it is more clear now! :)

@kriswallsmith Owner

Cool, thanks for humoring me :)

@asm89
asm89 added a note

Glad I was able to and thanks for all the great libs. :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Something went wrong with that request. Please try again.