Skip to content

Remove oppressive language from source code and documentation #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ fmt:

.PHONY: lint
lint:
golint $(PKGS) | ./etc/lintscreen.pl .lint-whitelist
golint $(PKGS) | ./etc/lintscreen.pl .lint-allowlist

.PHONY: lint-add-whitelist
lint-add-whitelist:
golint $(PKGS) | ./etc/lintscreen.pl -u .lint-whitelist
sort .lint-whitelist -o .lint-whitelist
.PHONY: lint-add-allowlist
lint-add-allowlist:
golint $(PKGS) | ./etc/lintscreen.pl -u .lint-allowlist
sort .lint-allowlist -o .lint-allowlist

.PHONY: errcheck
errcheck:
Expand Down
5 changes: 3 additions & 2 deletions benchmark/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"context"
"errors"

"go.mongodb.org/mongo-driver/internal"
"go.mongodb.org/mongo-driver/internal/testutil"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
Expand Down Expand Up @@ -50,7 +51,7 @@ func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error {
}
defer db.Client().Disconnect(ctx)

cmd := bsonx.Doc{{"ismaster", bsonx.Boolean(true)}}
cmd := bsonx.Doc{{internal.LegacyHelloLowercase, bsonx.Boolean(true)}}

tm.ResetTimer()
for i := 0; i < iters; i++ {
Expand All @@ -62,7 +63,7 @@ func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error {
// read the document and then throw it away to prevent
out, err := doc.MarshalBSON()
if len(out) == 0 {
return errors.New("output of ismaster is empty")
return errors.New("output of command is empty")
}
}
tm.StopTimer()
Expand Down
2 changes: 1 addition & 1 deletion cmd/docbuilder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var tmpl = `<!DOCTYPE html>
<head>
<meta http-equiv="refresh" content="5; url=https://godoc.org/go.mongodb.org/mongo-driver/{{.}}">
<meta name=go-import content="go.mongodb.org/mongo-driver git https://github.com/mongodb/mongo-go-driver.git">
<meta name="go-source" content="go.mongodb.org/mongo-driver https://github.com/mongodb/mongo-go-driver https://github.com/mongodb/mongo-go-driver/tree/master{/dir} https://github.com/mongodb/mongo-go-driver/blob/master{/dir}/{file}#L{line}">
<meta name="go-source" content="go.mongodb.org/mongo-driver https://github.com/mongodb/mongo-go-driver https://github.com/mongodb/mongo-go-driver/tree/HEAD{/dir} https://github.com/mongodb/mongo-go-driver/blob/HEAD{/dir}/{file}#L{line}">
</head>
<body>
Redirecting to docs...
Expand Down
24 changes: 19 additions & 5 deletions data/change-streams/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ drivers can use to prove their conformance to the Change Streams Spec.
Several prose tests, which are not easily expressed in YAML, are also presented
in this file. Those tests will need to be manually implemented by each driver.

Subdirectories for Test Formats
-------------------------------

This document describes the legacy format for change streams tests.
Tests in this legacy format are located under ``./legacy/``.

New change streams tests should be written in the `unified test format <../../unified-test-format/unified-test-format.rst>`__
and placed under ``./unified/``.

Spec Test Format
================

Expand All @@ -35,12 +44,12 @@ Each YAML file has the following keys:
- ``maxServerVersion``: Reserved for later use
- ``failPoint``: Optional configureFailPoint command document to run to configure a fail point on the primary server.
- ``target``: The entity on which to run the change stream. Valid values are:

- ``collection``: Watch changes on collection ``database_name.collection_name``
- ``database``: Watch changes on database ``database_name``
- ``client``: Watch changes on entire clusters
- ``topology``: An array of server topologies against which to run the test.
Valid topologies are ``single``, ``replicaset``, and ``sharded``.
Valid topologies are ``single``, ``replicaset``, ``sharded``, and "load-balanced".
- ``changeStreamPipeline``: An array of additional aggregation pipeline stages to add to the change stream
- ``changeStreamOptions``: Additional options to add to the changeStream
- ``operations``: Array of documents, each describing an operation. Each document has the following fields:
Expand Down Expand Up @@ -68,7 +77,7 @@ The definition of MATCH or MATCHES in the Spec Test Runner is as follows:
Pseudocode implementation of ``actual`` MATCHES ``expected``:

::

If expected is "42" or 42:
Assert that actual exists (is not null or undefined)
Else:
Expand Down Expand Up @@ -112,7 +121,7 @@ For each YAML file, for each element in ``tests``:
Transactions spec test documentation for more information.

- Create a new MongoClient ``client``
- Begin monitoring all APM events for ``client``. (If the driver uses global listeners, filter out all events that do not originate with ``client``). Filter out any "internal" commands (e.g. ``isMaster``)
- Begin monitoring all APM events for ``client``. (If the driver uses global listeners, filter out all events that do not originate with ``client``). Filter out any "internal" commands (e.g. ``hello`` or legacy hello)
- Using ``client``, create a changeStream ``changeStream`` against the specified ``target``. Use ``changeStreamPipeline`` and ``changeStreamOptions`` if they are non-empty. Capture any error.
- If there was no error, use ``globalClient`` and run every operation in ``operations`` in serial against the server until all operations have been executed or an error is thrown. Capture any error.
- If there was no error and ``result.error`` is set, iterate ``changeStream`` once and capture any error.
Expand All @@ -133,6 +142,11 @@ For each YAML file, for each element in ``tests``:
- For each (``expected``, ``idx``) in ``expectations``
- If ``actual[idx]`` is a ``killCursors`` event, skip it and move to ``actual[idx+1]``.
- Else assert that ``actual[idx]`` MATCHES ``expected``
- Note: the change stream test command event expectations cover a
prefix subset of all command events published by the driver.
The test runner MUST verify that, if there are N expectations, that the
first N events published by the driver match the expectations, and
MUST NOT inspect any subsequent events published by the driver.

- Close the MongoClient ``client``

Expand Down Expand Up @@ -199,7 +213,7 @@ The following tests have not yet been automated, but MUST still be tested. All t
- If ``resumeAfter`` was not specified, the ``getResumeToken`` result must be empty.

#. For a ``ChangeStream`` under these conditions:

- The batch is not empty.
- The batch has been iterated up to but not including the last element.

Expand Down
Loading