Move integration/prose tests into "mongo" and "bson" packages

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Testing
    • None
    • 🔵 Done
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      Currently almost all integration tests (e.g. tests that use mtest) are in the "internal/integration" directory rather in the directory with the code they test. Conventionally, Go tests are in the same package or directory as the code they test. Additionally, separating them creates filename collisions (e.g. client_test.go exists in two places), making it more difficult to quickly identify test files.

      In order to import mtest, tests cannot be in the mongo package because it creates an import cycle. However, we can move the test files to the same directory and use the [package]_test package name.

      Definition of done

      • Move files from the "internal/integration" directory into the directory where the code they test lives.
        • Rename all files from "[file]_test.go" to "[file]_integ_test.go"
        • Rename the package from "package [package]" to "package [package]_test".

      Pitfalls

      • Will create large diffs and potentially lose history, depending on how the move is done. Maybe that makes it not worth doing?
      • How do we move the files without losing the git history?

            Assignee:
            Unassigned
            Reporter:
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: