Skip to content

Commit 6385557

Browse files
authored
Remove oppressive language from source code and documentation (#717)
GODRIVER-2007 GODRIVER-2008
1 parent 1b281b8 commit 6385557

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1498
-1046
lines changed
File renamed without changes.

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ fmt:
5959

6060
.PHONY: lint
6161
lint:
62-
golint $(PKGS) | ./etc/lintscreen.pl .lint-whitelist
62+
golint $(PKGS) | ./etc/lintscreen.pl .lint-allowlist
6363

64-
.PHONY: lint-add-whitelist
65-
lint-add-whitelist:
66-
golint $(PKGS) | ./etc/lintscreen.pl -u .lint-whitelist
67-
sort .lint-whitelist -o .lint-whitelist
64+
.PHONY: lint-add-allowlist
65+
lint-add-allowlist:
66+
golint $(PKGS) | ./etc/lintscreen.pl -u .lint-allowlist
67+
sort .lint-allowlist -o .lint-allowlist
6868

6969
.PHONY: errcheck
7070
errcheck:

benchmark/single.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"context"
1111
"errors"
1212

13+
"go.mongodb.org/mongo-driver/internal"
1314
"go.mongodb.org/mongo-driver/internal/testutil"
1415
"go.mongodb.org/mongo-driver/mongo"
1516
"go.mongodb.org/mongo-driver/mongo/options"
@@ -50,7 +51,7 @@ func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error {
5051
}
5152
defer db.Client().Disconnect(ctx)
5253

53-
cmd := bsonx.Doc{{"ismaster", bsonx.Boolean(true)}}
54+
cmd := bsonx.Doc{{internal.LegacyHelloLowercase, bsonx.Boolean(true)}}
5455

5556
tm.ResetTimer()
5657
for i := 0; i < iters; i++ {
@@ -62,7 +63,7 @@ func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error {
6263
// read the document and then throw it away to prevent
6364
out, err := doc.MarshalBSON()
6465
if len(out) == 0 {
65-
return errors.New("output of ismaster is empty")
66+
return errors.New("output of command is empty")
6667
}
6768
}
6869
tm.StopTimer()

cmd/docbuilder/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var tmpl = `<!DOCTYPE html>
1717
<head>
1818
<meta http-equiv="refresh" content="5; url=https://godoc.org/go.mongodb.org/mongo-driver/{{.}}">
1919
<meta name=go-import content="go.mongodb.org/mongo-driver git https://github.com/mongodb/mongo-go-driver.git">
20-
<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}">
20+
<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}">
2121
</head>
2222
<body>
2323
Redirecting to docs...

data/change-streams/README.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ drivers can use to prove their conformance to the Change Streams Spec.
1818
Several prose tests, which are not easily expressed in YAML, are also presented
1919
in this file. Those tests will need to be manually implemented by each driver.
2020

21+
Subdirectories for Test Formats
22+
-------------------------------
23+
24+
This document describes the legacy format for change streams tests.
25+
Tests in this legacy format are located under ``./legacy/``.
26+
27+
New change streams tests should be written in the `unified test format <../../unified-test-format/unified-test-format.rst>`__
28+
and placed under ``./unified/``.
29+
2130
Spec Test Format
2231
================
2332

@@ -35,12 +44,12 @@ Each YAML file has the following keys:
3544
- ``maxServerVersion``: Reserved for later use
3645
- ``failPoint``: Optional configureFailPoint command document to run to configure a fail point on the primary server.
3746
- ``target``: The entity on which to run the change stream. Valid values are:
38-
47+
3948
- ``collection``: Watch changes on collection ``database_name.collection_name``
4049
- ``database``: Watch changes on database ``database_name``
4150
- ``client``: Watch changes on entire clusters
4251
- ``topology``: An array of server topologies against which to run the test.
43-
Valid topologies are ``single``, ``replicaset``, and ``sharded``.
52+
Valid topologies are ``single``, ``replicaset``, ``sharded``, and "load-balanced".
4453
- ``changeStreamPipeline``: An array of additional aggregation pipeline stages to add to the change stream
4554
- ``changeStreamOptions``: Additional options to add to the changeStream
4655
- ``operations``: Array of documents, each describing an operation. Each document has the following fields:
@@ -68,7 +77,7 @@ The definition of MATCH or MATCHES in the Spec Test Runner is as follows:
6877
Pseudocode implementation of ``actual`` MATCHES ``expected``:
6978

7079
::
71-
80+
7281
If expected is "42" or 42:
7382
Assert that actual exists (is not null or undefined)
7483
Else:
@@ -112,7 +121,7 @@ For each YAML file, for each element in ``tests``:
112121
Transactions spec test documentation for more information.
113122

114123
- Create a new MongoClient ``client``
115-
- 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``)
124+
- 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)
116125
- Using ``client``, create a changeStream ``changeStream`` against the specified ``target``. Use ``changeStreamPipeline`` and ``changeStreamOptions`` if they are non-empty. Capture any error.
117126
- 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.
118127
- If there was no error and ``result.error`` is set, iterate ``changeStream`` once and capture any error.
@@ -133,6 +142,11 @@ For each YAML file, for each element in ``tests``:
133142
- For each (``expected``, ``idx``) in ``expectations``
134143
- If ``actual[idx]`` is a ``killCursors`` event, skip it and move to ``actual[idx+1]``.
135144
- Else assert that ``actual[idx]`` MATCHES ``expected``
145+
- Note: the change stream test command event expectations cover a
146+
prefix subset of all command events published by the driver.
147+
The test runner MUST verify that, if there are N expectations, that the
148+
first N events published by the driver match the expectations, and
149+
MUST NOT inspect any subsequent events published by the driver.
136150

137151
- Close the MongoClient ``client``
138152

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

201215
#. For a ``ChangeStream`` under these conditions:
202-
216+
203217
- The batch is not empty.
204218
- The batch has been iterated up to but not including the last element.
205219

0 commit comments

Comments
 (0)