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 test cases #47

Merged
merged 27 commits into from
Jul 13, 2023
Merged

fix test cases #47

merged 27 commits into from
Jul 13, 2023

Conversation

mostafa-hisham
Copy link
Contributor

@stephywells In this PR I tried to fix Unit tests as much as I could.
now only 18 tests are failing with me locally.
I am not sure if this PR will fix the patchwork error https://github.com/Strategy11/another-wordpress-classifieds-plugin/actions/runs/4484949580/jobs/7885969046
but we can test it and see if it will help or not

@stephywells
Copy link
Contributor

@mostafa-hisham Thanks so much for all your work on these unit tests too. It would be great if we could circle back on this to get it all wrapped up. I just added it to the current sprint.

Copy link
Contributor

@stephywells stephywells left a comment

Choose a reason for hiding this comment

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

Yay! Thank so much for fixing this @mostafa-hisham !

I just have a question about the autoloader classes for prod vs dev.

@@ -105,6 +105,7 @@
'AWPCP_Container' => $baseDir . '/includes/class-container.php',
'AWPCP_ContainerConfiguration' => $baseDir . '/includes/class-container-configuration.php',
'AWPCP_ContainerConfigurationInterface' => $baseDir . '/includes/interface-container-configuration.php',
'AWPCP_ContainerConfigurationTestCase' => $baseDir . '/tests/includes/class-container-configuration-test-case.php',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add something to the release compiler to remove the test autoloader classes from production? Or do you think it's fine to leave here, even if the classes don't exist? It looks like the dev dependencies are listed here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can add --no-dev flag when running composer install or dumpautoload
it will not include dev dependencies

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a great plan! Would you mind adding this in so we don't have the dev dependencies included in the production code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran the composer with --no-dev and pushed the changes
but I really think that we should not push changes in vendor to the repo and we need to make a release or a production code
we should run composer install --no-dev

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a great plan. Maybe we should start with setting it up this way in BD first? I think it's fine to leave this one as is for now.

Copy link
Contributor

@stephywells stephywells left a comment

Choose a reason for hiding this comment

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

Thanks @mostafa-hisham ! The code looks great on this. Do you think we need any extra testing for the composer file changes?

@mostafa-hisham
Copy link
Contributor Author

@stephywells I don't think so.

@stephywells
Copy link
Contributor

Sounds good! Feel free to merge this whenever you're ready.

@mostafa-hisham
Copy link
Contributor Author

@stephywells I can not merge this pull request

image

@stephywells
Copy link
Contributor

Oops! Sorry about that @mostafa-hisham. This is fixed now.

@mostafa-hisham mostafa-hisham merged commit 83a3fe5 into master Jul 13, 2023
@mostafa-hisham mostafa-hisham deleted the fix-unit-tests branch July 13, 2023 18:59
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