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

Move the tests in Hyde/Hyde to Hyde/Framework #181

Closed
caendesilva opened this issue Apr 28, 2022 · 5 comments · Fixed by #185 or hydephp/hyde#115
Closed

Move the tests in Hyde/Hyde to Hyde/Framework #181

caendesilva opened this issue Apr 28, 2022 · 5 comments · Fixed by #185 or hydephp/hyde#115

Comments

@caendesilva
Copy link
Member

It makes more sense to keep tests for the framework here, instead of in the Hyde package.

@caendesilva
Copy link
Member Author

I think the tests will still have to be run from Hyde/Hyde, but just having the source code stored in Hyde/Framework would make it easier to version

@caendesilva
Copy link
Member Author

Unit tests should be able to be run from Framework, not sure how to merge the coverage though.

@caendesilva
Copy link
Member Author

Breaking down the problems I want to solve:

A: I want to run GitHub Actions to run tests for Framework code when code is changed in this repository
B: I want to define the tests here, because as it is now when I write new or change code here, I need to update the corresponding test in Hyde, making it hard to keep versions in sync.

I transferred the tests into Framework, but am having path issues. But I think I can solve both problems by loading the test files through the vendor directory but still running them through the Hyde installation. When running CI tests here, I can just set up so that before running tests, it clones the latest Hyde install.

@caendesilva
Copy link
Member Author

caendesilva commented Apr 28, 2022

Moved the unit and feature tests. Everything is passing except for some Pest tests testing Artisan commands. I think the easiest way to fix is to refactor to use PHPUnit for those.

Update: Fixed the tests

@caendesilva
Copy link
Member Author

Adding a todo:

To make testing more predictable, I want to create stubs for the content files that should be included in Hyde installs.
These would be:

  • _pages\index.blade.php
  • _pages\404.blade.php
  • _site\media\app.css

Before and after each test all content directories are deleted, and createsdefaultdirectories are run, and stubs republished.

The backup file helpers can then also be removed, as tests should never be run in a production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant