-
Notifications
You must be signed in to change notification settings - Fork 398
Phpunit tests fail on master branch #358
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
Comments
Are you sure it's failing on master? It's all green here |
@jadjoubran, it is all green for the reason I've explained:
We have something like this:
require("../angular/critical.css") inside laravel5-angular-material-starter/laravel5-angular-material-starter finds critical.css inside laravel5-angular-material-starter/angular/critical.css and not laravel5-angular-material-starter/laravel5-angular-material-starter/angular/critical.css as it "should". So the test passes ! Try to run phpunit on your locally cloned repo, it will fail. The require("../angular/critical.css") has to be fixed. I hope it is clear now |
I probably overcomplicated things on my application.. but I created a whole new task for my critical .scss file and compile it first into public/css... then I require it inside of my index file using: <!-- Critical CSS (Applied Immediately) -->
<style type="text/css">
<?php require( public_path( "css/critical.css" ) ) ?>
</style> This way I can use sass in my critical CSS... and I don't have a random *.css file sitting inside of my angular directory all by itself. |
@chihab okay it makes sense now, thanks! |
@jadjoubran, could you please explain what is the purpose of that critical.css and its require ? I see that it includes some app-shell style definitions, probably related to pwa then.. |
@chihab yes indeed, this is concerned with the app shell |
@jadjoubran why not simply inline app-shell css in the html ? Without an external critical css file and a need to require it in some way.
If there is really a need to make it external, for design purpose, maybe using a gulp css inlining task like https://www.npmjs.com/package/gulp-inline-css would solve the problem I guess. |
@chihab yeah it used to be simply inlined in the HTML, but I thought about moving it to a different file for the developer experience.. especially when the shell code goes slightly larger than this btw wouldn't @hackur's suggestion work? using and then I liked his idea because converting this critical.css file into scss will allow us to use the same variables that we have (mainly the color variables) |
Okay @jadjoubran it makes sense. :) Following @hackur 's solution, we would have this then on gulpfile (along with the public_path on require)
The critical.css would be renamed to critical.scss. If we'd like to move critical.scss to material folder we would have to the some wildcard playings to exclude it from the first .sass call. If that solutions suits you, I'll make a PR on that issue. Really want to send a PR for Travis issue #356 , the current CI builds are confusing. :) |
Yes looks great 😄 except for one issue, it seems that Thanks for your contribution 😄 Your PR is more than welcome |
Oh yes, I see, I'll try to send the two PRs today. :) |
…d add gulp task to handle it
* fixed package.json issue #353 * test travis build * fixed package.json issue #353 * add composer install and move install commands to install step * move php artisan migrate to script step * move php artisan key and jwg generation to composer post installation phase * replace create-project phases by install ones * fix previous commit * [fix] issue #358: sassify critical inlined style for pwa and add gulp task to handle it
re-opened to fix issues discussed in #356 |
…ar-material-starter * 'master' of https://github.com/jadjoubran/laravel5-angular-material-starter: removed bold font + removed browsersync. closes jadjoubran#290 Fixes issues jadjoubran#356 and jadjoubran#358 (jadjoubran#361)
* fixed package.json issue #353 * test travis build * fixed package.json issue #353 * add composer install and move install commands to install step * move php artisan migrate to script step * move php artisan key and jwg generation to composer post installation phase * replace create-project phases by install ones * fix previous commit * [fix] issue #358: sassify critical inlined style for pwa and add gulp task to handle it * [fix] fix composer deletion issue, consider key/jwt on travis ci * [fix] add .env copy to travis build * [fix] revert all changes on composer.json
Before submitting a PR for #356, there is an issue to be fixed, otherwise the PR for #356 would make the build failing on Travis.
If we follow these steps locally, the build fails on phpunit and returns this error:
Phpunit will comlain:
On Travis, the build passes because the "../angular/critical.css" refers to the Travis cloned repo and not the composer create-project repo inside it ! So, the file is found in the upper folder and so the build passes ! These two directory levels on Travis build will be removed after #356 fix.
The fix is to be made on that line I suppose (index.blade.php: 17)
<style><?php require("../angular/critical.css") ?></style>
Important: even if phpunit fails, the applications runs well (with php artisan serve).
I'll submit the PR on #356 once all phpunit tests run successfully.
Question:
How do you tell Packagist that the current stable version is tagged 3.2.1 ? (and not the one on master branch)
The text was updated successfully, but these errors were encountered: