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

Added support for debugging tests #360

Merged
merged 9 commits into from
Dec 24, 2019
Merged

Added support for debugging tests #360

merged 9 commits into from
Dec 24, 2019

Conversation

itsgoingd
Copy link
Owner

@itsgoingd itsgoingd commented Nov 5, 2019

This PR adds an ability to collect ran tests as "requests" to be shown in the Clockwork app. Every test ran, eg. RssEntryDecoratorTest::content_can_be_parsed, is shown as a request.

These requests have all the metadata, like timeline, executed database queries, log messages, etc. collected during the test run and test-specific metadata like test name, status (passed, failed, skipped..), list of asserts with arguments and failure message.

Included is a Laravel integration that can be enabled by adding a Clockwork testing trait to tests/TestCase.php:

use Clockwork\Support\Laravel\Tests\UsesClockwork;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication, DatabaseMigrations, UsesClockwork;
}

(see app PR for screenshots)

  • added "type" to requests (currently "request" or "test") and test-specific metadata (testName, testStatus, testStatusMessage, testAsserts)
  • added Clockwork::resolveTest method for resolving current request as "test" request with test-specific metadata
  • added support for collecting test runs in Laravel integration (w/ default PHPUnit setup)
  • app PR - Added support for debugging tests underground-works/clockwork-app#23

@itsgoingd itsgoingd changed the title WIP: Added support for debugging tests Added support for debugging tests Dec 24, 2019
@itsgoingd itsgoingd merged commit a9b84ac into master Dec 24, 2019
@itsgoingd itsgoingd mentioned this pull request Apr 7, 2020
@itsgoingd itsgoingd deleted the tests-profiling branch December 1, 2020 23:07
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.

None yet

1 participant