-
Notifications
You must be signed in to change notification settings - Fork 230
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
Having no tests causes the build to fail. #926
Comments
I believe real issue is not that there were no tests, but that there were no Go packages:
Whereas if you have a package:
I'm not sure why Go made the distinction to treat "no matching packages" as a test failure; I guess to avoid mistakes. I believe if you have a matching Go package without tests Encore won't treat the tests as failing. All that said, maybe Encore should treat this scenario as failing the build, and not just the tests? The "One or more tests failed" error is certainly confusing. |
Ok I reproed this.
![]()
![]() |
But did you actually commit the |
Aha I'm not sure I did :) will close! |
Issue
builds fails if you do not have any test files.
How to repro
![image](https://private-user-images.githubusercontent.com/3738421/278264420-6ad51b97-07bf-4f39-b218-197ce02deb15.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NzA0NTYsIm5iZiI6MTcxODk3MDE1NiwicGF0aCI6Ii8zNzM4NDIxLzI3ODI2NDQyMC02YWQ1MWI5Ny0wN2JmLTRmMzktYjIxOC0xOTdjZTAyZGViMTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjFUMTE0MjM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDNhMmNlZmYwYzkxZjUxMjc4ZGJlNDE1ZjE0ZGMzZDE2N2Q0NTM3Nzc2MDQwZWE2MjQ3MWY2NTUxMWFmYjg5MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.8S8wxKHNL0Sn2BkjC05b3kXXwrC0AL41rrwDeXwvyas)
Consider an app with the following structure:
when I deploy it, the build fails as there are no tests.
![image](https://private-user-images.githubusercontent.com/3738421/278264039-38ea3627-0586-4ecd-b13e-7b825508f7d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NzA0NTYsIm5iZiI6MTcxODk3MDE1NiwicGF0aCI6Ii8zNzM4NDIxLzI3ODI2NDAzOS0zOGVhMzYyNy0wNTg2LTRlY2QtYjEzZS03YjgyNTUwOGY3ZDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjFUMTE0MjM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmZmODlkNWM2MWVmMGEwYzA1MzQzMjMwNGY3ZjFjNThhYTlhYjdlOWE3MmE3ZDM3ZjMxMzk3OWNlODNhYjViNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.hN5H1hMo8XFho0LDROdhH6D_e3LkFt16E2V7BcRRs9Q)
Adding an empty test file fixes it:
![image](https://private-user-images.githubusercontent.com/3738421/278264611-40ea60ae-37ee-4b41-98ae-57ae58f94c12.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg5NzA0NTYsIm5iZiI6MTcxODk3MDE1NiwicGF0aCI6Ii8zNzM4NDIxLzI3ODI2NDYxMS00MGVhNjBhZS0zN2VlLTRiNDEtOThhZS01N2FlNThmOTRjMTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjFUMTE0MjM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWIyM2Y1M2IzM2E4ZjRmOWZiODMxYTU1YjliOWQzN2QyNWI2ZjAyYWQ2M2M0N2IyNjBhMWJmNTBjODVlNWVkNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.pUWXUhvBE14qIvv6yJpyMCbg_hDPqHxUhz_FsrmUE8U)
Expectation
Whilst bad practise, there is situations where having no test files is fine. I think providing a warning log but the build succeeding would be a good outcome.
The text was updated successfully, but these errors were encountered: