Skip to content
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
2 changes: 1 addition & 1 deletion build/ci/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
54 changes: 53 additions & 1 deletion build/ci/win_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ func TestDeploymentsLocalWithAuthIndexDeprecated(t *testing.T) {
"--type",
"local",
"--debug",
"-P",
internal.ProfileName(),
)

cmd.Env = os.Environ()
Expand All @@ -442,6 +444,8 @@ func TestDeploymentsLocalWithAuthIndexDeprecated(t *testing.T) {
"--type",
"local",
"--debug",
"-P",
internal.ProfileName(),
)
cmd.Env = os.Environ()
r, err := cmd.CombinedOutput()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should only skip it on windows maybe check runtime.GOOS?


if testing.Short() {
t.Skip("skipping test in short mode")
}
Expand Down Expand Up @@ -77,7 +79,6 @@ func TestDeploymentsLocalSeedFail(t *testing.T) {
"--username", dbUsername,
"--password", dbUserPassword,
"--initdb", "./testdata/db_seed_fail",
"--bindIpAll",
"--force",
"--debug",
"-P",
Expand Down
Loading