Skip to content
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

GODRIVER-3061 Support Load Balancing in Docker Container #1494

Merged
merged 24 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
clean up and use updated drivers-tools
  • Loading branch information
blink1073 committed Dec 11, 2023
commit 4562e8a0365d25c379afc0f544bb0a4439bced2f
4 changes: 2 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ timeout:
ls -la
functions:
fetch-source:
# Executes git clone and applies the submitted patch, if any
# Executes clone and applies the submitted patch, if any
- command: git.get_project
type: system
params:
Expand Down Expand Up @@ -145,7 +145,7 @@ functions:
# If this was a patch build, doing a fresh clone would not actually test the patch
cp -R ${PROJECT_DIRECTORY}/ $DRIVERS_TOOLS
else
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
git clone -b docker-update https://github.com/blink1073/drivers-evergreen-tools.git $DRIVERS_TOOLS
blink1073 marked this conversation as resolved.
Show resolved Hide resolved
fi
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config
- command: shell.exec
Expand Down
1 change: 0 additions & 1 deletion etc/docker_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ cd /src
rm -f test.suite
cp -r $HOME/install ./install

export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
export PATH="$MONGODB_BINARIES:$PATH"

# Run the test.
Expand Down
35 changes: 3 additions & 32 deletions etc/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,17 @@ if [ -z "$DRIVERS_TOOLS" ]; then
exit 1
fi
PLATFORM=${DOCKER_PLATFORM:-}

pushd $DRIVERS_TOOLS/.evergreen/docker/ubuntu20.04
docker build $PLATFORM -t drivers-evergreen-tools .
popd
docker build $PLATFORM -t go-test .

# Handle environment variables and optional positional arg for the makefile target.

MAKEFILE_TARGET=${1:-evg-test-versioned-api}
MONGODB_VERSION=${MONGODB_VERSION:-latest}
TOPOLOGY=${TOPOLOGY:-replica_set}
ORCHESTRATION_FILE=${ORCHESTRATION_FILE:-basic.json}
AUTH=${AUTH:-""}
SSL=${SSL:=""}
GO_BUILD_TAGS=${GO_BUILD_TAGS:-""}

ARGS="$PLATFORM --rm -i"
ARGS="$ARGS -e MONGODB_VERSION=$MONGODB_VERSION -e TOPOLOGY=$TOPOLOGY"
ARGS="$ARGS -e MAKEFILE_TARGET=$MAKEFILE_TARGET -e AUTH=$AUTH"
ARGS="$ARGS -e ORCHESTRATION_FILE=$ORCHESTRATION_FILE -e SSL=$SSL"
ARGS=" -e MAKEFILE_TARGET=$MAKEFILE_TARGET"
ARGS="$ARGS -e GO_BUILD_TAGS=$GO_BUILD_TAGS"
ARGS="$ARGS -e DRIVERS_TOOLS=/root/drivers-evergeen-tools"

# Ensure host.docker.internal is available on MacOS.
if [ "$(uname -s)" = "Darwin" ]; then
ARGS="$ARGS -e MONGODB_URI=mongodb://host.docker.internal"
fi

# Ensure host network is available on Linux.
if [ "$(uname -s)" = "Linux" ]; then
ARGS="$ARGS --network=host"
fi

# If there is a tty, add the -t arg.
test -t 1 && ARGS="-t $ARGS"

ARGS="$ARGS -v `pwd`:/src"
ARGS="$ARGS -v $DRIVERS_TOOLS:/root/drivers-evergreen-tools"
ARGS="$ARGS go-test"

docker run $ARGS go-test
$DRIVERS_TOOLS/.evergreen/docker/run-client.sh $ARGS
if [ -f "test.suite" ]; then
tail test.suite
fi
4 changes: 4 additions & 0 deletions x/mongo/driver/operation/hello_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ func TestAppendClientPlatform(t *testing.T) {
func TestEncodeClientMetadata(t *testing.T) {
clearTestEnv(t)

if len(os.Getenv("DOCKER_RUNNING")) > 0 {
blink1073 marked this conversation as resolved.
Show resolved Hide resolved
t.Skip("These tests gives different results when run in Docker due to extra environment data.")
}

type application struct {
Name string `bson:"name"`
}
Expand Down
3 changes: 3 additions & 0 deletions x/mongo/driver/topology/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ func TestServerHeartbeatTimeout(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
if len(os.Getenv("DOCKER_RUNNING")) > 0 {
blink1073 marked this conversation as resolved.
Show resolved Hide resolved
t.Skip("Skipping this test in docker.")
}

networkTimeoutError := &net.DNSError{
IsTimeout: true,
Expand Down