-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Ignore Horizon routes #3
Conversation
Thanks, @adampatterson, I agree it would be good to also ignore Horizon routes by default. |
@zepfietje I like that, you may not want to track dashboard or admin views. I'll update my PR over the next few days to pull from an array in the pirsch config file. |
Not tracking dashboard or admin views is quite easy already by just removing (or not adding) the middleware from those routes. So this feature would be most useful for third-party package routes. But yes, might as well use it to simplify ignoring a group of routes. Let me know when you're ready by marking this PR as ready for review. 😊 |
Is this ready for review, @adampatterson? 🙂 |
@zepfietje Iet me double check this weekend. I had Pirsch running on a server that Oracle decided to delete on me 🙃 |
No rush, @adampatterson! Just wondered what the status of this PR was :) |
Replaced by #9. |
Sorry, I no longer had a way of testing with Pirsh. |
No worries, @adampatterson. |
@zepfietje what's the best method for testing Pircsh since the trial is limited to 30 days? |
I'm sure @Kugelschieber can help you test it for a little longer if needed. 🙂 |
@adampatterson I can extend your trial. Can you send an email to [email protected] with your account email address? |
@zepfietje I went ahead and updated my branch with the latest changes and tested in Pirsh and everything seems to be working as expected but I did notice something odd with the unit tests. I have never used PEST before so duplicated a few previous tests and set the configs as if I were going to exclude a custom route or header. https://github.com/adampatterson/laravel-pirsch/blob/middleware/tests/TrackPageviewTest.php#L50 And they passed, so naturally I tried to break the test and it kept passing. I then went back to a previous test and modified the I then modified the test it's self and it kept passing. return [
'excluded_routes' => [
//
],
, it('skips Telescope', function () {
Pirsch::spy();
Route::middleware(TrackPageview::class)
->get('thisshouldcall/test', fn() => 'Hello World');
$this->get('/thisshouldcall/test');
Pirsch::shouldNotHaveBeenCalled();
}); I would expect this to fail since the route is not excluded. |
I noticed that the routes for Telescope were ignored and thought that it would also be good to exclude Horizons routes.