Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23023

Disable clang-format for function values in jstests/tool/csvexport1.js

    • Fully Compatible
    • TIG 11 (03/11/16)

      jstests/tool/csvexport1.js compares a stored function in the database to an expected value in the test. When clang-format reformats the function, it introduces platform-specific newlines that differ from the newlines stored in the database.

      We should disable clang-format for the 'function foo' values in this test to avoid failures like this:

      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 assert: ["function foo() {\r\n        print(\"Hello World!\");\r\n    }"] != ["function foo() {\n        print(\"Hello World!\");\n    }"] are not equal : CSV export 2
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 doassert@src/mongo/shell/assert.js:15:14
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 assert.eq@src/mongo/shell/assert.js:51:5
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 @jstests\tool\csvexport1.js:76:13
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 2016-03-09T01:38:47.135+0000 E QUERY    [thread1] Error: ["function foo() {\r\n        print(\"Hello World!\");\r\n    }"] != ["function foo() {\n        print(\"Hello World!\");\n    }"] are not equal : CSV export 2 :
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 doassert@src/mongo/shell/assert.js:15:14
      [js_test:csvexport1] 2016-03-09T01:38:47.134+0000 assert.eq@src/mongo/shell/assert.js:51:5
      [js_test:csvexport1] 2016-03-09T01:38:47.135+0000 @jstests\tool\csvexport1.js:76:13
      [js_test:csvexport1] 2016-03-09T01:38:47.135+0000 
      [js_test:csvexport1] 2016-03-09T01:38:47.135+0000 failed to load: jstests\tool\csvexport1.js
      

            Assignee:
            michael.grundy Michael Grundy
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: