[SERVER-22632] Restructure DocumentSources and their tests. Created: 16/Feb/16  Updated: 31/Oct/16  Resolved: 24/Oct/16

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.4.0-rc2

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2016-10-31
Participants:

 Description   

We currently have a bit of a weird setup of DocumentSources and their unit tests:

  1. All DocumentSources are declared within the same header file: src/mongo/db/pipeline/document_source.h. This isn't so bad, but makes it harder to jump back and forth between the header and the cpp file.
  2. Each DocumentSource implementation is declared in its own file, e.g. src/mongo/db/pipeline/document_source_match.cpp.
  3. All unit tests live in one file: src/mongo/db/pipeline/document_source_test.cpp, but each implementation has it's own namespace, with some common types of tests in each namespace, sometimes with identical names. This is quite annoying to navigate.
  4. Since SERVER-19542 was resolved, some tests in src/mongo/db/pipeline/pipeline_test.cpp are testing functionality that is now the responsibility of the DocumentSource itself.

We should resolve these discrepancies by adding a separate header file and test file for each DocumentSource, and moving the tests from pipeline to the new test files as appropriate. It may be worthwhile to create a sub-directory within src/mongo/db/pipeline for DocumentSources.



 Comments   
Comment by Githook User [ 24/Oct/16 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-22632 Split up document_source.h into one header per stage.
Branch: master
https://github.com/mongodb/mongo/commit/4fb763d868070414ca0af76b84ff8937b3773832

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