[SERVER-23023] Disable clang-format for function values in jstests/tool/csvexport1.js Created: 09/Mar/16  Updated: 21/Nov/16  Resolved: 09/Mar/16

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.2.5, 3.3.3

Type: Task Priority: Major - P3
Reporter: Kamran K. Assignee: Michael Grundy
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: TIG 11 (03/11/16)
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 09/Mar/16 ]

Author:

{u'username': u'mgrundy', u'name': u'Mike Grundy', u'email': u'michael.grundy@10gen.com'}

Message: SERVER-23023 Disable clang-format for function values in jstests/tool/csvexport1.js

(cherry picked from commit 9345aac2959c067e1a4d23283074bc805f8ad1f3)
Branch: v3.2
https://github.com/mongodb/mongo/commit/f313d9f91a28661b0a7fc18eb6216596ce0051fb

Comment by Githook User [ 09/Mar/16 ]

Author:

{u'username': u'mgrundy', u'name': u'Mike Grundy', u'email': u'michael.grundy@10gen.com'}

Message: SERVER-23023 Disable clang-format for function values in jstests/tool/csvexport1.js
Branch: master
https://github.com/mongodb/mongo/commit/9345aac2959c067e1a4d23283074bc805f8ad1f3

Generated at Thu Feb 08 04:02:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.