Permalink
Browse files

Constantize the JS threshold to make Yoono happy

  • Loading branch information...
mattbasta committed Oct 19, 2012
1 parent d2fc1f2 commit c402e4a82cfa262f30fa6d8bb29a05be53caeee7
Showing with 6 additions and 1 deletion.
  1. +4 −0 validator/constants.py
  2. +2 −1 validator/testcases/content.py
View
@@ -51,6 +51,10 @@
# The maximum size of any string in JS analysis.
MAX_STR_SIZE = 1024 * 24 # 24KB
+# The maximum number of JS files that can be exhaustively validated in one
+# package.
+MAX_JS_THRESHOLD = 900
+
# Graciously provided by @kumar in bug 614574
if (not SPIDERMONKEY_INSTALLATION or
not os.path.exists(SPIDERMONKEY_INSTALLATION)):
@@ -5,6 +5,7 @@
from regex import run_regex_tests
from validator.contextgenerator import ContextGenerator
+from validator.constants import MAX_JS_THRESHOLD

This comment has been minimized.

Show comment
Hide comment
@robhudson

robhudson Oct 22, 2012

Contributor

s > t

@robhudson

robhudson Oct 22, 2012

Contributor

s > t

from validator import decorator
from validator import submain as testendpoint_validator
from validator import unicodehelper
@@ -203,7 +204,7 @@ def test_packed_scripts(err, xpi_package):
total_scripts = sum(len(bundle["scripts"]) for bundle in scripts)
exhaustive = True
- if total_scripts > 1000:
+ if total_scripts > MAX_JS_THRESHOLD:
err.warning(
err_id=("testcases_content", "packed_js", "too_much_js"),
warning="TOO MUCH JS FOR EXHAUSTIVE VALIDATION",

2 comments on commit c402e4a

@robhudson

This comment has been minimized.

Show comment
Hide comment
@robhudson

robhudson Oct 22, 2012

Contributor

r+ on this commit. Though I'm curious why you dropped it by 100?

Contributor

robhudson replied Oct 22, 2012

r+ on this commit. Though I'm curious why you dropped it by 100?

@mattbasta

This comment has been minimized.

Show comment
Hide comment
@mattbasta

mattbasta Oct 22, 2012

Owner

Previously, Yoono had > 1000 JS files. Now it has ~950. Bleh.

Owner

mattbasta replied Oct 22, 2012

Previously, Yoono had > 1000 JS files. Now it has ~950. Bleh.

Please sign in to comment.