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 integration tests #390

Closed

Conversation

connersaeli
Copy link
Collaborator

@connersaeli connersaeli commented Aug 20, 2024

This PR fixes a silently failing integration test that also blocked other tests from running. It also fixes the subsequent failing tests that were masked by this bug. This PR does not fix the high-level problem that the integration tests silently fail when a test class is not properly constructed, but I believe that should be addressed in a separate PR.

Description

  • Refactor internal dashboard test to properly set up the test
  • Fix the content-type that the test is comparing to match Rocky 8 tests from before. There was previously logic to compare different content-types returned by the different operating systems (CentOS 7 and Rocky 8). These content-types rules for Rocky 8 were not properly copied before and caused the tests to erroneously fail. More info here.
  • Fix a warning in the EfficiencyControllerProviderTest by matching the test class to the test's filename

Motivation and Context

This bug in the test was introduced in #373 with the upgrade from phpunit version ~4 to version 9.6.

Arguments are passed to that test class's constructor, however phpunit's TestCase class does not accept any arguments and causes the test to fail. This is problematic because the test fails silently and does not execute the other tests. This is silently failing error from the test:

{"success":false,"count":0,"total":0,"totalCount":0,"results":[],"data":[],"message":"Too few arguments to function IntegrationTests\\REST\\internal_dashboard\\DashboardSupremmTest::__construct(), 0 passed in \/root\/xdmod\/vendor\/phpunit\/phpunit\/src\/Framework\/TestBuilder.php on line 138 and exactly 3 expected","code":0}

In addition to this test failing, there were subsequent tests that were also failing but never got executed. This PR includes fixes for those tests as well.

https://app.asana.com/0/159049597309611/1208001546005416

Tests performed

Tested by running the integration test runtests.sh script in a container and verifying that all tests pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@connersaeli connersaeli marked this pull request as ready for review August 21, 2024 19:17
@connersaeli connersaeli added this to the 11.0.0 milestone Aug 21, 2024
@connersaeli connersaeli self-assigned this Aug 21, 2024
@aaronweeden aaronweeden mentioned this pull request Aug 21, 2024
6 tasks
@connersaeli connersaeli mentioned this pull request Aug 22, 2024
6 tasks
@connersaeli
Copy link
Collaborator Author

New PR for this: #392

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