From 7e989aca00de3d259d8d7f6a5b11c300ead7e3d2 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 31 Aug 2020 14:14:17 +0300 Subject: Add check for "chroma.js" dataTables extension plugin * test/requests/link_checker.py (check_packaged_js_files): Add it. --- test/requests/link_checker.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 12057203..d29e5965 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -97,6 +97,8 @@ def check_packaged_js_files(args_obj, parser): # Datatables plugins: "/DataTablesExtensions/plugins/sorting/natural.js", "/DataTablesExtensions/plugins/sorting/scientific.js", + # Other js libraries + "/chroma/chroma.min.js" ] print("Checking links") -- cgit v1.2.3 From db0ba01a135902f5b90ca1674f064371e710a959 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Mon, 31 Aug 2020 17:55:19 +0300 Subject: Add check for "d3-tip.js" js library * test/requests/link_checker.py (check_packaged_js_files): Add it. --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index d29e5965..31f0dc34 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -99,6 +99,7 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries "/chroma/chroma.min.js" + "/d3-tip/d3-tip.js" ] print("Checking links") -- cgit v1.2.3 From b37e6862978a89bcb1abd5790f8ae17f017130db Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Sep 2020 14:10:32 +0300 Subject: Check availability of several js and css files * test/requests/link_checker.py: Check availability of: chroma.min.js; d3-tip.js; d3.min.js; underscore.min.js; nv.d3.min.css; and jquery.qtip.min.js --- test/requests/link_checker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 31f0dc34..eee79b78 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -98,8 +98,12 @@ def check_packaged_js_files(args_obj, parser): "/DataTablesExtensions/plugins/sorting/natural.js", "/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries - "/chroma/chroma.min.js" - "/d3-tip/d3-tip.js" + "/chroma/chroma.min.js", + "/d3-tip/d3-tip.js", + "/d3js/d3.min.js", + "/js_alt/underscore.min.js", + "/nvd3/nv.d3.min.css", + "/qtip2/jquery.qtip.min.js", ] print("Checking links") -- cgit v1.2.3 From d747b95a258f4d606d4aa4442d153d6e163cf0de Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Sep 2020 19:20:53 +0300 Subject: Add check for "md5.min.js" library * test/requests/link_checker.py: Add it. --- test/requests/link_checker.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index eee79b78..47454c75 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -104,6 +104,7 @@ def check_packaged_js_files(args_obj, parser): "/js_alt/underscore.min.js", "/nvd3/nv.d3.min.css", "/qtip2/jquery.qtip.min.js", + "/js_alt/md5.min.js", ] print("Checking links") -- cgit v1.2.3 From 86fd0e0bec0c56ffa7857d9bf8c2c0dac25f99dc Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 4 Sep 2020 01:02:38 +0300 Subject: Fix false positive tests * test/requests/link_checker.py: (verify_static_file): Add it. Verify that a static link is fetched by checking for the message "Error: 404 not Found" in page. (check_package_js_files): Add appropriate 'js' or 'css' prefix. --- test/requests/link_checker.py | 53 +++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index 47454c75..d040ba54 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -52,6 +52,21 @@ def verify_link(link): if DO_FAIL: raise ex + +def verify_static_file(link): + print("verifying "+link) + try: + result = requests.get(link, timeout=20, verify=False) + if (result.status_code == 200 and + result.content.find("Error: 404 Not Found") <= 0): + print(link+" ==> OK") + else: + print("ERROR: link {}".format(link)) + raise Exception("Failed verify") + except ConnectionError as ex: + print("ERROR: ", link, ex) + + def check_page(host, start_url): print("") print("Checking links host "+host+" in page `"+start_url+"`") @@ -85,28 +100,28 @@ def check_packaged_js_files(args_obj, parser): host = args_obj.host js_files = [ # Datatables Extensions: - "/DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css", - "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", - "/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", - "/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", - "/DataTablesExtensions/colResize/dataTables.colResize.js", - "/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", - "/DataTablesExtensions/buttons/js/buttons.colVis.min.js", - "/DataTables/js/jquery.dataTables.js", - "/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", + "/css/DataTablesExtensions/buttonsBootstrap/css/buttons.bootstrap.css", + "/js/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/css/DataTablesExtensions/buttonStyles/css/buttons.dataTables.min.css", + "/js/DataTablesExtensions/buttons/js/dataTables.buttons.min.js", + "/js/DataTablesExtensions/colResize/dataTables.colResize.js", + "/js/DataTablesExtensions/colReorder/js/dataTables.colReorder.js", + "/js/DataTablesExtensions/buttons/js/buttons.colVis.min.js", + "/js/DataTables/js/jquery.dataTables.js", + "/css/DataTablesExtensions/scroller/css/scroller.dataTables.min.css", # Datatables plugins: - "/DataTablesExtensions/plugins/sorting/natural.js", - "/DataTablesExtensions/plugins/sorting/scientific.js", + "/js/DataTablesExtensions/plugins/sorting/natural.js", + "/js/DataTablesExtensions/plugins/sorting/scientific.js", # Other js libraries - "/chroma/chroma.min.js", - "/d3-tip/d3-tip.js", - "/d3js/d3.min.js", - "/js_alt/underscore.min.js", - "/nvd3/nv.d3.min.css", - "/qtip2/jquery.qtip.min.js", - "/js_alt/md5.min.js", + "/js/chroma/chroma.min.js", + "/js/d3-tip/d3-tip.js", + "/js/d3js/d3.min.js", + "/js/js_alt/underscore.min.js", + "/js/nvd3/nv.d3.min.css", + "/js/qtip2/jquery.qtip.min.js", + "/js/js_alt/md5.min.js", ] print("Checking links") for link in js_files: - verify_link(host+link) + verify_static_file(host+link) -- cgit v1.2.3