Reviewers: kpreid2,

Description:
The version skew tests rely on making a set of caja js files that
have the wrong version number, so instead of version 4650 the
files would claim to be version 0000 or 4650mmm.

These files are created by string-replacing the current version
4650 with the fake version.

The flakiness happens when there are false positive matches, like
es53-taming-frame.js could have
    'cajoledDate':1372196894650
which is harmless when 4650 becomes 0000, but causes a js syntax
error when 4650 becomes 4650mmm.

This fixes the flakiness by making the version substitution precise.

Please review this at https://codereview.appspot.com/10576043/

Affected files:
  M     build.xml


Index: build.xml
===================================================================
--- build.xml   (revision 5460)
+++ build.xml   (working copy)
@@ -1456,8 +1456,12 @@
     <copy todir="${war}/testing/skew-0000/${build.svnVersion}">
       <fileset dir="${war}/${build.svnVersion}" includes="*.js"/>
     </copy>
-    <replace dir="${war}/testing/skew-0000"
-        token="${build.svnVersion}" value="0000"/>
+    <replaceregexp
+        flags="g"
+        match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'[m\d]+'"
+        replace="\1'0000'">
+      <fileset dir="${war}/testing/skew-0000" includes="**/*.js"/>
+    </replaceregexp>

     <property name="ver.mmm" value="${build.svnVersion}mmm"/>
     <mkdir dir="${war}/testing/skew-mmm/${ver.mmm}"/>
@@ -1466,8 +1470,12 @@
     <copy todir="${war}/testing/skew-mmm/${ver.mmm}" overwrite="true">
       <fileset dir="${war}/${build.svnVersion}" includes="*.js"/>
     </copy>
-    <replace dir="${war}/testing/skew-mmm"
-        token="${build.svnVersion}" value="${ver.mmm}"/>
+    <replaceregexp
+        flags="g"
+        match="(cajaBuildVersion\s*=|'cajolerVersion':)\s*'[m\d]+'"
+        replace="\1'${ver.mmm}'">
+      <fileset dir="${war}/testing/skew-mmm" includes="**/*.js"/>
+    </replaceregexp>
   </target>

   <!-- Copy third-party JARs to the WAR directory -->


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to