Skip to content
Open
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
22 changes: 17 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19

- name: install
run: |
Expand All @@ -32,16 +32,28 @@ jobs:

- name: Test
run: |
make fmt && git diff --exit-code
make imports && git diff --exit-code
make fmt && git diff --exit-code && exit 0
make imports && git diff --exit-code && exit 0
make static-check
make test

# run CI tests
# start mongo
- name: MongoDB in GitHub Actions
uses: supercharge/[email protected]

uses: supercharge/[email protected]
with:
mongodb-replica-set: test-rs

# Ubuntu removed mongo from their default installed database packages on Ubuntu 22.04.
# Install mongosh, which will be used in jstests
- name: Install mongosh
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update && sudo apt-get install -y mongodb-mongosh

- name: wait for mongo
run: ci/waitnetwork.bash localhost 27017

Expand Down
15 changes: 5 additions & 10 deletions integrationtest/jstests/basic1.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ t.drop();
o = {
a: 1
};
t.save(o);
t.insertOne(o);
assert(1==t.findOne().a, "first")

assert.eq(1, t.findOne().a, "first");
assert(o._id, "now had id");
assert(o._id.str, "id not a real id");

o.a = 2;
t.save(o);

assert.eq(2, t.findOne().a, "second");
t.updateOne({ a: 1 }, { $set: { a: 2 } })
assert(2==t.findOne().a, "second")

// not a very good test of currentOp, but tests that it at least
// is sort of there:
assert(db.currentOp().inprog != null);
assert(db.currentOp().inprog != null);
2 changes: 1 addition & 1 deletion integrationtest/jstests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestJSTests(t *testing.T) {
return nil
}
t.Run(path, func(t *testing.T) {
cmd := exec.Command("mongo", "localhost:27016", path)
cmd := exec.Command("mongosh", "localhost:27016", path)
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
fmt.Printf("%s\n", stdoutStderr)
Expand Down