diff --git a/build/ci/evergreen.yml b/build/ci/evergreen.yml index 73301d44f6..6ab915a101 100644 --- a/build/ci/evergreen.yml +++ b/build/ci/evergreen.yml @@ -1324,7 +1324,7 @@ tasks: host: ${public_ip_address} user: atlascli identity_file: ${workdir}/src/github.com/mongodb/mongodb-atlas-cli/build/ci/terraform/id_rsa - cmd: "powershell -NonInteractive -ExecutionPolicy Bypass -File C:\\Users\\atlascli\\win_test.ps1 -goproxy ${go_proxy} -revision ${github_commit}" + cmd: "powershell -NonInteractive -ExecutionPolicy Bypass -File C:\\Users\\atlascli\\win_test.ps1 -goproxy ${go_proxy} -revision ${github_commit} -docker_username ${dockerhub_username} -docker_pat ${dockerhub_password}" - name: atlas_deployments_windows_10 tags: ["e2e","deployments","windows"] must_have_test_results: true diff --git a/build/ci/win_test.ps1 b/build/ci/win_test.ps1 index 425cadc143..a7c609ab4f 100644 --- a/build/ci/win_test.ps1 +++ b/build/ci/win_test.ps1 @@ -7,14 +7,40 @@ .PARAMETER REVISION Specifies the value of REVISION to be fetched by git. + + .PARAMETER DOCKER_USERNAME + Specifies the value of DOCKER_USERNAME for Docker Hub authentication. + + .PARAMETER DOCKER_PAT + Specifies the value of DOCKER_PAT for Docker Hub authentication. #> param( [String]$GOPROXY = "https://proxy.golang.org,direct", - [String]$REVISION = "HEAD" + [String]$REVISION = "HEAD", + [String]$DOCKER_USERNAME, + [String]$DOCKER_PAT ) Write-Output 'Disable Windows Defender...' Set-MpPreference -DisableRealtimeMonitoring $true -Force + +Write-Output 'Setting up docker credentials...' +$credentialString = "${DOCKER_USERNAME}:${DOCKER_PAT}" +$credentialBytes = [System.Text.Encoding]::UTF8.GetBytes($credentialString) +$base64Credentials = [System.Convert]::ToBase64String($credentialBytes) +New-Item -Path "$env:HOME\.docker" -ItemType "Directory" -Force +$dockerConfig = @" +{ + "auths": { + "https://index.docker.io/v1/": { + "auth": "$base64Credentials" + } + } +} +"@ +$dockerConfig | Set-Content -Path "$env:HOME\.docker\config.json" -Encoding ASCII +Write-Output "Docker credentials saved successfully to $env:HOME\.docker\config.json" + Write-Output "Start Docker" Start "C:\Program Files\Docker\Docker\Docker Desktop.exe" Write-Output "Clone" @@ -25,6 +51,32 @@ git checkout $REVISION Write-Output "Vendor dependencies" $env:GOPROXY=$GOPROXY tar -xzf ../vendor.tar.gz + +Write-Output "Waiting for Docker daemon to start..." +$maxAttempts = 60 # Wait up to 60 seconds +$attempt = 0 + +while ($attempt -lt $maxAttempts) { + try { + docker version | Out-Null + if ($LASTEXITCODE -eq 0) { + Write-Output "Docker daemon is ready!" + break + } + } + catch { + # Ignore errors while waiting + } + + Start-Sleep -Seconds 1 + $attempt++ + Write-Output "Waiting for Docker daemon to start... $attempt/$maxAttempts" +} + +if ($attempt -eq $maxAttempts) { + Write-Output "`nTimeout: Docker daemon did not start within $maxAttempts seconds" + exit 1 +} Write-Output "Docker pull" docker pull "mongodb/mongodb-atlas-local:latest" Write-Output "Run tests" diff --git a/test/e2e/atlas/deployments/local/auth/deprecated/deploymentslocalauthindexdeprecated/deployments_local_auth_index_deprecated_test.go b/test/e2e/atlas/deployments/local/auth/deprecated/deploymentslocalauthindexdeprecated/deployments_local_auth_index_deprecated_test.go index 17f4ee4ea9..9a26d1269b 100644 --- a/test/e2e/atlas/deployments/local/auth/deprecated/deploymentslocalauthindexdeprecated/deployments_local_auth_index_deprecated_test.go +++ b/test/e2e/atlas/deployments/local/auth/deprecated/deploymentslocalauthindexdeprecated/deployments_local_auth_index_deprecated_test.go @@ -424,6 +424,8 @@ func TestDeploymentsLocalWithAuthIndexDeprecated(t *testing.T) { "--type", "local", "--debug", + "-P", + internal.ProfileName(), ) cmd.Env = os.Environ() @@ -442,6 +444,8 @@ func TestDeploymentsLocalWithAuthIndexDeprecated(t *testing.T) { "--type", "local", "--debug", + "-P", + internal.ProfileName(), ) cmd.Env = os.Environ() r, err := cmd.CombinedOutput() diff --git a/test/e2e/atlas/deployments/local/seed/deploymentslocalseedfail/deployments_local_seed_fail_test.go b/test/e2e/atlas/deployments/local/seed/deploymentslocalseedfail/deployments_local_seed_fail_test.go index ecc6ba8718..2c0523fc6c 100644 --- a/test/e2e/atlas/deployments/local/seed/deploymentslocalseedfail/deployments_local_seed_fail_test.go +++ b/test/e2e/atlas/deployments/local/seed/deploymentslocalseedfail/deployments_local_seed_fail_test.go @@ -28,6 +28,8 @@ const ( ) func TestDeploymentsLocalSeedFail(t *testing.T) { + t.Skip("DISABLED: This test hangs on evergreen (not locally), ticket to fix this: https://jira.mongodb.org/browse/CLOUDP-365460") + if testing.Short() { t.Skip("skipping test in short mode") } @@ -77,7 +79,6 @@ func TestDeploymentsLocalSeedFail(t *testing.T) { "--username", dbUsername, "--password", dbUserPassword, "--initdb", "./testdata/db_seed_fail", - "--bindIpAll", "--force", "--debug", "-P",