Skip to content

feat: add Laravel integration test matrix #115

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

Merged
merged 21 commits into from
Jan 21, 2022
Merged

Conversation

bishopb
Copy link

@bishopb bishopb commented Nov 23, 2021

Description of the change

We integrate with Laravel versions 5.5+. The existing tests verify unit functionality with TestBench but has a few caveats. First, it tests the package against the latest version of Laravel on the PHP engine running the test. Second, as written, there was no version constraint for testbench 3, which is the only way to get Laravel 5 tests. Third, the tests do not perform an end to end test of actual logging within a Laravel application. Finally, the tests do not cover Laravel Zero or Lumen (or Nova, for that matter).

The drawback with this architecture is that changes meant to be backwards compatible could only be verified by manually changing composer JSON and, in the case of PHP engine compatibility, by running with engine alternatives. Additionally, if the package had side effects during its logging operation (such as raising a warning), these would not be noticed by the unit tests.

Combined, these drawbacks make forward progress difficult, because they leave dark many potential in-the-field corners we want to see.

This PR adds a Laravel test matrix that covers Laravel 5.5 through Laravel 8 and on supported underlying PHP versions, coordinated to work with the legacy lineages.

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)

Related issues

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 5 commits November 19, 2021 09:53
This is the basic operation: stand up the framework, configure
Rollbar within that framework, then invoke a log message. Rig
Rollbar so that logged messages get written to a file, that we
then check exists and contains the desired value.

Later iterations will add the specifics for each framework-version,
which may require multiple action files: the setup varies slightly
between framework and framework-version.
Never store secrets. Also, by pushing the secret definition into
the runner, we have more flexibility for choosing their value based
on branch conditions (eg, for testing certain behaviors of various
tokens).
@bishopb bishopb requested a review from bxsx November 23, 2021 03:54
The [docs][1] call for `4.*` and `2.*`, so we'll use those to align
with the exact documentation.

[1]:https://docs.rollbar.com/docs/laravel
@bishopb bishopb marked this pull request as draft November 23, 2021 04:21
Bishop Bettini added 11 commits December 6, 2021 21:33
Now we'll add them in one at a time, excluding or fixing the bad
combo.
Covers Laravel 5.6 through 8, on the appropriate PHP versions from
the 7.x series. Comments out a known failing combination of Laravel
5.5 and doesn't include the unlikely to work PHP 8 support.
Hunting down why failing on GitHub action but not local `act`.
The runner is removing leading zeroes, setting the value to '0'.
This failed locally, but it may have been a false negative.
@bishopb bishopb marked this pull request as ready for review December 9, 2021 03:21
@bishopb bishopb mentioned this pull request Dec 10, 2021
12 tasks
Bishop Bettini added 3 commits December 15, 2021 09:54
Now that we've proved out the support (from prior runs where the
matrix encompassed all supported versions and was hitting released
tags) and we have a baseline of known support, we can break out
the code into lineage branches. In this regime (which matches
rollbar-php operation), commits to the lineage branch are checked
against the documented support for that lineage.
@bxsx
Copy link

bxsx commented Jan 11, 2022

Why PHP v8 is not supported in the test matrix?

@jmarronm jmarronm self-requested a review January 19, 2022 11:16
Copy link

@jmarronm jmarronm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Bishop

all work committed on the laravel-test-matrix branch. Laravel, Lumen, and Laravel Zero covered for currently working version combinations. Additional PR are needed to align actual working behavior with documented and expected behavior.

@bishopb Can you please track the details of the expected behavior in a new ticket and we will merge this PR as complete? Thanks

@bishopb bishopb merged commit a7a5096 into master Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants