Fix for Windows 10 (#648)

* ps: add cdefault conf

* init - add config

* add required env vars for win10

* update test_e2e.ps1 to use go build -mod=vendor
This commit is contained in:
marpio
2018-09-13 22:57:37 +02:00
committed by Aaron Schlesinger
parent 89d7b35ccd
commit f25c427239
4 changed files with 15 additions and 9 deletions
+1
View File
@@ -107,6 +107,7 @@ if ($alldeps.IsPresent) {
if ($dev.IsPresent) {
& docker-compose -p athensdev up -d mongo
& docker-compose -p athensdev up -d redis
execScript "create_default_config.ps1"
}
if ($test.IsPresent) {
+3
View File
@@ -131,6 +131,9 @@ func PrepareEnv(gopath string) []string {
if runtime.GOOS == "windows" {
cmdEnv = append(cmdEnv, fmt.Sprintf("USERPROFILE=%s", os.Getenv("USERPROFILE")))
cmdEnv = append(cmdEnv, fmt.Sprintf("SystemRoot=%s", os.Getenv("SystemRoot")))
cmdEnv = append(cmdEnv, fmt.Sprintf("ALLUSERSPROFILE=%s", os.Getenv("ALLUSERSPROFILE")))
cmdEnv = append(cmdEnv, fmt.Sprintf("HOMEDRIVE=%s", os.Getenv("HOMEDRIVE")))
cmdEnv = append(cmdEnv, fmt.Sprintf("HOMEPATH=%s", os.Getenv("HOMEPATH")))
}
return cmdEnv
+6
View File
@@ -0,0 +1,6 @@
$repoDir = Join-Path $PSScriptRoot ".." | Join-Path -ChildPath ".."
if (-not (Join-Path $repoDir config.toml | Test-Path)) {
$example = Join-Path $repoDir config.example.toml
$target = Join-Path $repoDir config.toml
Copy-Item $example $target
}
+5 -9
View File
@@ -1,6 +1,5 @@
# Execute end-to-end (e2e) tests to verify that everything is working right
# from the end user perpsective
Get-Process -Name *buffalo*
$repoDir = Join-Path $PSScriptRoot ".." | Join-Path -ChildPath ".."
if (-not (Test-Path env:GO_BINARY_PATH)) { $env:GO_BINARY_PATH = "go" }
@@ -21,8 +20,7 @@ function clearGoModCache () {
}
function stopProcesses () {
Get-Process -Name buffalo* -ErrorAction SilentlyContinue | Stop-Process -Force
Get-Process -Name athens-build* -ErrorAction SilentlyContinue | Stop-Process -Force
Get-Process -Name proxy* -ErrorAction SilentlyContinue | Stop-Process -Force
}
function teardown () {
@@ -40,11 +38,13 @@ function teardown () {
}
try {
$env:GO111MODULE = "on"
## Start the proxy in the background and wait for it to be ready
Push-Location $(Join-Path $repoDir cmd | Join-Path -ChildPath proxy)
## just in case something is still running
stopProcesses
Start-Process -NoNewWindow buffalo dev
& go build -mod=vendor
Start-Process -NoNewWindow .\proxy.exe
$proxyUp = $false
do {
@@ -60,11 +60,7 @@ try {
$testSource = Join-Path $testGoPath "happy-path"
git clone https://github.com/athens-artifacts/happy-path.git ${testSource}
Push-Location ${testSource}
## set modules on after running buffalo dev, not sure why
## issue https://github.com/gomods/athens/issues/412
$env:GO111MODULE = "on"
$env:GOPATH = $testGoPath
## Make sure that our test repo works without the GOPROXY first
if (Test-Path env:GOPROXY) { Remove-Item env:GOPROXY }