Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test failures in 1.x #510

Merged
merged 8 commits into from
Jan 6, 2021
Merged

Fix test failures in 1.x #510

merged 8 commits into from
Jan 6, 2021

Conversation

bishopb
Copy link
Contributor

@bishopb bishopb commented Jan 1, 2021

Description of the change

Running the tests in v1.8.1 results in several failures, more so if you're using a modern PHP environment (because so much has been deprecated and removed since PHP 5). In order to be able to fix bugs in 1.x, we need our tests, so first order of business is to get the tests running. This PR implements that.

Additionally, this PR adds a docker container to allow for local test runs in PHP 5.6, using the same image the CI pipeline uses. The built image is tagged as rollbar/rollbar-php:1. Example usage:

$ composer docker-build
$ composer docker-run
composer docker-run
> docker run -it -v "${PWD}":/opt/rollbar/rollbar-php rollbar/rollbar-php:1
root@6b5748709f96:/opt/rollbar/rollbar-php# composer test
> phpunit --coverage-clover build/logs/clover.xml --coverage-html build/logs/coverage --testsuite 'Rollbar Test Suite'
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

...............................................................  63 / 508 ( 12%)
............................................................... 126 / 508 ( 24%)
............................................................... 189 / 508 ( 37%)
............................................................... 252 / 508 ( 49%)
..............S.............................................S.. 315 / 508 ( 62%)
............................................................... 378 / 508 ( 74%)
............................................................... 441 / 508 ( 86%)
............................................................... 504 / 508 ( 99%)
....

Time: 1.72 minutes, Memory: 53.50MB

OK, but incomplete, skipped, or risky tests!
Tests: 508, Assertions: 920, Skipped: 2.

Generating code coverage report in Clover XML format ... done

Generating code coverage report in HTML format ... done
> phpcs --standard=PSR1,PSR2 src tests

Code coverage in HTML format has been added as well. open build/logs/coverage/index.html to see it. Example:
image

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

Bishop Bettini added 8 commits January 1, 2021 13:33
When necessary, pin it to the last version in the series, knowing
that a new release will never come. Where new releases look likely,
let the pin flex upward. (Compare phpunit 4 vs. psr/log.)
Not currently reporting the generated clover, but regardless a
developer is more interested in immediate feedback. The HTML
provides that. Use as: `open build/logs/coverage/index.html` on
MacOS or generally open that `index.html` file in a browser.
Create a container that has the same setup as a GitHub action, so
that developers can use the library in an isolated environment that
mirrors the CI pipeline.
@bishopb bishopb self-assigned this Jan 1, 2021
@bishopb bishopb added Rank: 1 - Critical Tackle above all other actionable requests. Status: 3 - Construction The request is being worked on. Type: Bug Fix a component so that its behavior aligns with its documentation. labels Jan 1, 2021
@bishopb bishopb merged commit 12c79ba into next/1.x/main Jan 6, 2021
@bishopb bishopb deleted the next/1.x/direct-route branch January 9, 2021 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rank: 1 - Critical Tackle above all other actionable requests. Status: 3 - Construction The request is being worked on. Type: Bug Fix a component so that its behavior aligns with its documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants