24-offline-all-assets.t broken with webpack dev environment

Bug #1754894 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

Evergreen Master
OpenSRF Master
O/S Ubuntu 14.04.5 Trusty Tahr

So, it looks like the test named in the subject line is presently broken because the grep for 404, among other things is maybe not specific enough. Here is some sample output:

wget --no-check-certificate -m https://localhost/eg/staff/offline-interface 2>&1| grep -B2 404
--2018-03-10 15:45:07-- https://localhost/robots.txt
Reusing existing connection to [localhost]:443.
HTTP request sent, awaiting response... 404 Not Found
2018-03-10 15:45:07 ERROR 404: Not Found.
--
--2018-03-10 15:45:08-- https://localhost/js/ui/default/staff/build/js/angular-tablesort.js
Reusing existing connection to [localhost]:443.
HTTP request sent, awaiting response... 404 Not Found
2018-03-10 15:45:08 ERROR 404: Not Found.
--
Reusing existing connection to [localhost]:443.
HTTP request sent, awaiting response... 200 OK
Length: 45404 (44K)
--
     0K .......... .......... .......... .......... .... 100% 101M=0s

2018-03-10 15:45:08 (101 MB/s) - ‘localhost/js/ui/default/staff/build/fonts/glyphicons-halflings-regular.ttf’ saved [45404/45404]

Notice that the response length of 45404 also matches the pattern of 404. We should probably be looking for '404 Not Found.'

Now, I have to figure out why angular-tablesort.js is missing...

NOTE: The test succeeds sometimes and fails at others. It succeeded the first time that I ran it today, but later began failing consistently.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I find angular-tablesort.js at the following location on both the above VM and another with master installed on Ubuntu 16.04.4 Xenial Xerus:

/openils/var/web/js/ui/default/staff/node_modules/angular-tablesort/js/angular-tablesort.js

description: updated
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Ah, OK. So a little more poking shows that the test is failing legitimately. There's a later grep for https that throws out the ones that the content length of 45404.

It looks like angular-tablesort.js is not being placed where offline-interface is looking for it. This could possibly explain my issues in bug 1751498. If moving the file reference resolves that bug, I will make this one a duplicate.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Ah ha!

Revision history for this message
Jason Stephenson (jstephenson) wrote :

All right, so the test fails consistently if I use "npm run build" rather than "npm run build-prod."

I can also fix it by adding the path to angluar-tablesort.js to the list of JS_FILES in webpack.config.js.

I'll see if I can figure out how to fix this for the dev environment.

summary: - 24-offline-all-assets.t broken
+ 24-offline-all-assets.t broken with webpack dev environment
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Working branch: user/dyrcona/lp1754894-webpack-dev-env-fix

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dyrcona/lp1754894-webpack-dev-env-fix

It does not appear that watchOptions.ignored does exactly what it says on the tin. It seem to completely ignore the files and not build them.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I need to slow down and be more coherent.

After first build with npm run build, the test seems to pass.

Later, if you update code and do npm run build again is when the test fails.

I'm not sure the branch above is the proper approach, but it seems to fix things for me.

So, when testing new code, I usually do npm udate; npm run build in the staff client directory before doing make & make install.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.