sabre-io / http

The sabre/http library provides utilities for dealing with http requests and responses.
http://sabre.io/http/
BSD 3-Clause "New" or "Revised" License
187 stars 62 forks source link

[tests-only] [5.1] skip testParseMimeTypeOnInvalidMimeType #223

Closed phil-davis closed 1 year ago

phil-davis commented 1 year ago

I added markTestSkipped for testParseMimeTypeOnInvalidMimeType I left the test there for completeness. And it can be run locally if someone wants to see what happens:

$ export EXECUTE_INVALID_MIME_TYPE_TEST=true
$ composer phpunit
> phpunit --configuration tests/phpunit.xml
PHPUnit 9.6.10 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

...............................................................  63 / 167 ( 37%)
.../home/phil/git/sabre-io/http/lib/functions.php:333:
array(1) {
  [0] =>
  string(17) "invalid_mime_type"
}

Fixes #222

This is the workaround that I can think of - it at least makes it so that the rest of the unit tests actually run.

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (5.1@f67757f). Click here to learn what that means. The diff coverage is n/a.

@@          Coverage Diff           @@
##             5.1     #223   +/-   ##
======================================
  Coverage       ?   94.48%           
  Complexity     ?      263           
======================================
  Files          ?       15           
  Lines          ?      924           
  Branches       ?        0           
======================================
  Hits           ?      873           
  Misses         ?       51           
  Partials       ?        0           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

phil-davis commented 1 year ago

https://github.com/sabre-io/http/actions/runs/5892772777/job/15982808250?pr=223

PHPUnit 9.6.10 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

...............................................................  63 / 167 ( 37%)
...S........................................................... 126 / 167 ( 75%)
.........................................                       167 / 167 (100%)

Time: 00:18.539, Memory: 79.99 MB

OK, but incomplete, skipped, or risky tests!
Tests: 167, Assertions: 304, Skipped: 1.

There is one S in the test output, indicating a skipped test. The other tests all run and pass - good.

phil-davis commented 1 year ago

Note: phpunit also emits:

Suggestion:    Migrate your XML configuration using "--migrate-configuration"

We need to allow unit tests to run in CI on older PHP versions for 5.x, so we can't do that migrate-configuration here in the 5.1 branch. We just ignore that - it is sorted out in the later major releases 6 and 7.