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

[Testing] Fix running unit test on macOS #4941

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Nette\Utils\FileSystem;
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassMethod;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\BetterPhpDocParser\PhpDoc\StringNode;
Expand Down Expand Up @@ -39,6 +40,7 @@ protected function setUp(): void
$this->phpDocInfoFactory = $this->make(PhpDocInfoFactory::class);
}

#[RunInSeparateProcess]
public function test(): void
{
[$inputContent, $expectedContent] = FixtureSplitter::split(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function test(array $inputParameters, string $expectedCommand): void
2000
);

$workerCommandLine = str_replace("'main_script' worker", "'main_script' '' worker", $workerCommandLine);
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a notes here that it's macos related? Just to avoid false removal in the future.
Same for the one above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively add a macos github action job

Copy link
Member

Choose a reason for hiding this comment

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

@staabm That would be great too, but comment is easy pick for warning in case of local cleanup. CI should only verify edge cases, not inform about them.

Copy link
Member Author

Choose a reason for hiding this comment

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

$this->assertSame($expectedCommand, $workerCommandLine);
}

Expand Down