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 junit parallel #1073

Merged
merged 4 commits into from
Jan 25, 2024
Merged

Fix junit parallel #1073

merged 4 commits into from
Jan 25, 2024

Conversation

nuernbergerA
Copy link
Contributor

@nuernbergerA nuernbergerA commented Jan 24, 2024

What:

  • Bug Fix

Description:

  • revert JUnit Plugin so arguments can be used by paratest
  • paratest makes direct calles to Junit logger (was overwritten by a noop class because we implement a own listener like we did for TeamCity) <- this was a bad idea
  • copy pasted the latest original JunitXmlLogger
  • injected the pest logging converter and replaced the small bits where we need to resolve pest names and filepaths
  • changed the files as little as possible to keep future diffs as minimal as possible
  • added comments on each line i modified to ensure its crystal clear what we changed

Related:

Fixes #1070
Caused by #887 and b9d2be8

How to test

    "require-dev": {
        "pestphp/pest": "dev-fix-junit-parallel as v2.33"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/nuernbergerA/pest"
        }
    ],

@nuernbergerA
Copy link
Contributor Author

@calebdw can you please test and confirm if this fixes all issues?

@calebdw
Copy link
Contributor

calebdw commented Jan 24, 2024

I'm testing now

@calebdw
Copy link
Contributor

calebdw commented Jan 24, 2024

I'm having trouble installing it:

$ composer update -W
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires pestphp/pest-plugin-faker ^2.0 -> satisfiable by pestphp/pest-plugin-faker[v2.0.0, 2.x-dev].
    - pestphp/pest-plugin-faker[v2.0.0, ..., 2.x-dev] require pestphp/pest ^2.0.0 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-
fix-junit-parallel).
  Problem 2
    - Root composer.json requires spatie/pest-plugin-test-time ^2.0 -> satisfiable by spatie/pest-plugin-test-time[2.0.0].
    - spatie/pest-plugin-test-time 2.0.0 requires pestphp/pest ^2.0 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-fix-junit-para
llel).
  Problem 3
    - pestphp/pest-plugin-laravel 2.x-dev requires pestphp/pest ^2.22.0 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-fix-junit-
parallel).
    - pestphp/pest-plugin-laravel v2.0.0 requires pestphp/pest ^2.0.0 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-fix-junit-pa
rallel).
    - pestphp/pest-plugin-laravel v2.1.0 requires pestphp/pest ^2.8.3 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-fix-junit-pa
rallel).
    - pestphp/pest-plugin-laravel v2.2.0 requires pestphp/pest ^2.13.0 -> found pestphp/pest[2.x-dev] but it conflicts with your root composer.json require (dev-fix-junit-p
arallel).
    - Root composer.json requires pestphp/pest-plugin-laravel ^2.0 -> satisfiable by pestphp/pest-plugin-laravel[v2.0.0, v2.1.0, v2.2.0, 2.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

@nuernbergerA
Copy link
Contributor Author

nuernbergerA commented Jan 24, 2024

@calebdw if updated the composer json

note the as v2.33 part to "trick" the plugins

    "require-dev": {
        "pestphp/pest": "dev-fix-junit-parallel as v2.33"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/nuernbergerA/pest"
        }
    ],

@calebdw
Copy link
Contributor

calebdw commented Jan 24, 2024

@nuernbergerA, everything seems to work great!

@nunomaduro
Copy link
Member

@nuernbergerA After merging this pull request, the --log-junit works with parallel and non-parallel right?

@nuernbergerA
Copy link
Contributor Author

@nunomaduro yes i double checked it and can confirm that it works with and without parallel.

@nunomaduro nunomaduro merged commit 4febd8a into pestphp:2.x Jan 25, 2024
32 checks passed
@nuernbergerA nuernbergerA deleted the fix-junit-parallel branch January 25, 2024 10:31
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.

[Bug]: Pest crashes when trying to output JUnit
3 participants