chore(e2e): Update go mod download to run on the correct user (#6227)

* chore(e2e): Ensure go modules are downloaded for test user

* chore(e2e): Add additional debug lines in script

* chore(e2e): Exclude boundary-ui clone when zipping boundary src
pull/6230/head
Michael Li 5 months ago committed by GitHub
parent 4a7342b074
commit 89c577ddd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -325,7 +325,7 @@ resource "archive_file" "boundary_src_zip" {
type = "zip"
source_dir = var.boundary_src_path
output_path = "${path.root}/.terraform/tmp/boundary-src.zip"
excludes = ["**/enos/**", "**/node_modules/**", "bin/**", "**/.git/**", "plugins/**/*.gz", "website/**"]
excludes = ["**/enos/**", "**/node_modules/**", "bin/**", "**/.git/**", "plugins/**/*.gz", "website/**", "**/ui/.tmp/**"]
}
resource "enos_local_exec" "add_boundary_src" {
@ -375,7 +375,9 @@ resource "enos_local_exec" "run_powershell_script" {
enos_local_exec.wait_for_ssh,
]
inline = ["ssh -i ${abspath(local_sensitive_file.private_key.filename)} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no Administrator@${aws_instance.client.public_ip} ${local.test_dir}/${basename(local_file.powershell_script[0].filename)}"]
# running this script as test_username so that go modules will be set up for
# the user used for RDP tests
inline = ["ssh -i ${abspath(local_sensitive_file.private_key.filename)} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ${local.test_username}@${aws_instance.client.public_ip} ${local.test_dir}/${basename(local_file.powershell_script[0].filename)}"]
}
# used for debug

@ -2,10 +2,12 @@
# SPDX-License-Identifier: BUSL-1.1
# Unzip Boundary CLI to the same directory
Write-Host "Unzipping Boundary CLI..."
$destination = Split-Path -Path ${boundary_cli_zip_path}
Expand-Archive -Path ${boundary_cli_zip_path} -DestinationPath $destination -Force
# Unzip boundary src to new directory
Write-Host "Unzipping Boundary source code..."
$base = [System.IO.Path]::GetFileNameWithoutExtension("${boundary_src_zip_path}")
$src_destination = Join-Path (Split-Path ${boundary_src_zip_path}) $base
Expand-Archive -Path ${boundary_src_zip_path} -DestinationPath $src_destination -Force
@ -58,11 +60,13 @@ choco install cmake --version 3.31.8 -y
refreshenv
# Set the github token if provided
Write-Host "Checking if GitHub token is provided..."
if ("${github_token}" -ne "") {
# configure git to be able to download from private repos
git config --system url."https://oauth2:${github_token}@github.com".insteadOf "https://github.com"
# download opencv artifact if available
Write-Host "Downloading OpenCV artifact.."
[Environment]::SetEnvironmentVariable("GITHUB_TOKEN", "${github_token}", [EnvironmentVariableTarget]::Machine)
choco install gh -y
refreshenv
@ -100,6 +104,7 @@ if ("${github_token}" -ne "") {
)
# go mod download
Write-Host "Downloading Go modules at $src_destination..."
cd $src_destination
go mod download
}

Loading…
Cancel
Save