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

Add PHP 8.2 to CI #448

Merged
merged 1 commit into from
Jan 23, 2023
Merged

Add PHP 8.2 to CI #448

merged 1 commit into from
Jan 23, 2023

Conversation

norkunas
Copy link
Collaborator

@norkunas norkunas commented Jan 18, 2023

Pull Request

Related issue

Fixes #<issue_number>

What does this PR do?

  • Adds PHP 8.2 to CI tests;
  • Turns out also fixes a bug on Index->getTasks() where the custom set indexUids are not properly merged into payload.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

sort($results);
sort($expected);

$this->assertSame($results, $expected);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sort always returns true, so phpstan complained about that: Call to method PHPUnit\Framework\Assert::assertSame() with true and true will always evaluate to true.

Copy link
Collaborator Author

@norkunas norkunas Jan 18, 2023

Choose a reason for hiding this comment

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

And voila, now tests fails because the expectations were wrong :D

1) Tests\Endpoints\IndexTest::testGetTasks
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 (
     0 => 'index_2b37af8be3c1639bd46d3d8b08a16f'
+    1 => 'other-index'
 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what this code is supposed to test so waiting for feedback

Copy link
Member

Choose a reason for hiding this comment

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

Hi @norkunas thanks for pointing this out.

The idea was to test the ability to compose a getTasks request from an index instance where I could also use the value defined inside the instance.

In this case, we want to get all the tasks from both $this->index and other-index. And we just want to ensure the presence of both indexUids in the response. They don't need to respect the order in the array btw.

When I implemented this test I didn't realize that sort() affects the value instead of creating a new array 🤦.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There was a bug :)

@@ -18,7 +18,8 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
coverage: none
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By default when non setting coverage: none xdebug is installed, so this just avoids

@@ -32,7 +33,8 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.2
coverage: none
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same here

name: integration-tests (PHP ${{ matrix.php-versions }})
steps:
- uses: actions/checkout@v1
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Later we could introduce coverage if needed, but currently also disabled to avoid installing xdebug

@norkunas norkunas force-pushed the ci82 branch 5 times, most recently from 1a30939 to 6eee219 Compare January 20, 2023 04:41
@norkunas
Copy link
Collaborator Author

All green, if you want I can split a bugfix into separate PR

Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

bors merge

Thanks for your contribution @norkunas 🤘

@bors
Copy link
Contributor

bors bot commented Jan 23, 2023

@bors bors bot merged commit 4201c69 into meilisearch:main Jan 23, 2023
@norkunas norkunas deleted the ci82 branch January 23, 2023 13:43
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.

2 participants