From 30a81a01203e934b2d2e39e9de336b8888a5b2d3 Mon Sep 17 00:00:00 2001 From: Scott Hain Date: Tue, 28 May 2019 15:07:11 -0700 Subject: [PATCH 1/5] Swap windows jobs to docker Signed-off-by: Scott Hain --- .expeditor/verify.pipeline.yml | 180 +++++++++++++++++++++++++++++++-- support/ci/shared.ps1 | 5 + 2 files changed, 176 insertions(+), 9 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 05045e115e..d6fb703609 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -48,7 +48,13 @@ steps: command: - .\test\run_clippy.ps1 stable .\test\unexamined_lints.txt .\test\allowed_lints.txt .\test\lints_to_fix.txt .\test\denied_lints.txt agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 25 ####################################################################### @@ -374,6 +380,12 @@ steps: - ./test/run_cargo_test.ps1 builder-api-client agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 25 retry: automatic: @@ -384,6 +396,12 @@ steps: - ./test/run_cargo_test.ps1 butterfly -Nightly -Features "lock_as_mutex deadlock_detection" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 soft_fail: true @@ -392,6 +410,12 @@ steps: - ./test/run_cargo_test.ps1 butterfly -Nightly -Features "lock_as_rwlock deadlock_detection" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -404,6 +428,12 @@ steps: - ./test/run_cargo_test.ps1 butterfly -TestOptions "--test-threads=1 --ignored" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 soft_fail: true @@ -412,6 +442,12 @@ steps: - ./test/run_cargo_test.ps1 common -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -422,6 +458,12 @@ steps: - ./test/run_cargo_test.ps1 core agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -432,6 +474,12 @@ steps: - ./test/run_cargo_test.ps1 hab agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -442,6 +490,12 @@ steps: - ./test/run_cargo_test.ps1 http-client agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -452,6 +506,12 @@ steps: - ./test/run_cargo_test.ps1 launcher-client agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 10 retry: automatic: @@ -462,6 +522,12 @@ steps: - ./test/run_cargo_test.ps1 launcher-protocol agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 10 retry: automatic: @@ -472,6 +538,12 @@ steps: - ./test/run_cargo_test.ps1 pkg-export-docker agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -482,6 +554,12 @@ steps: - ./test/run_cargo_test.ps1 pkg-export-tar agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -493,6 +571,12 @@ steps: - ./test/run_cargo_test.ps1 sup -Features "lock_as_mutex" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 40 soft_fail: true @@ -502,6 +586,12 @@ steps: - ./test/run_cargo_test.ps1 sup -Features "lock_as_rwlock" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 40 retry: automatic: @@ -513,6 +603,12 @@ steps: - ./test/run_cargo_test.ps1 sup -Features "nitox_stream" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 40 retry: automatic: @@ -523,6 +619,12 @@ steps: - ./test/run_cargo_test.ps1 sup-client agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -533,6 +635,12 @@ steps: - ./test/run_cargo_test.ps1 sup-protocol agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -543,6 +651,12 @@ steps: - ./test/run_studio_test.ps1 "studio-from-source" agents: queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 5 retry: automatic: @@ -746,7 +860,13 @@ steps: command: - ./support/ci/build_component.ps1 hab agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -758,7 +878,13 @@ steps: command: - ./support/ci/build_component.ps1 launcher agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -770,7 +896,13 @@ steps: command: - ./support/ci/build_component.ps1 pkg-export-docker agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -782,7 +914,13 @@ steps: command: - ./support/ci/build_component.ps1 pkg-export-tar agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -794,7 +932,13 @@ steps: command: - ./support/ci/build_component.ps1 plan-build-ps1 agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -806,7 +950,13 @@ steps: command: - ./support/ci/build_component.ps1 studio agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -818,7 +968,13 @@ steps: command: - ./support/ci/build_component.ps1 sup agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 @@ -830,7 +986,13 @@ steps: command: - ./support/ci/build_component.ps1 windows-service agents: - queue: 'single-use-windows-privileged' + queue: 'default-windows-privileged' + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true retry: automatic: limit: 1 diff --git a/support/ci/shared.ps1 b/support/ci/shared.ps1 index 2aa0dc2901..445daed066 100644 --- a/support/ci/shared.ps1 +++ b/support/ci/shared.ps1 @@ -50,6 +50,11 @@ function Install-Habitat { Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | out-null } + choco source Add -Name artifactory -Source http://artifactory-preprod.chef.co/api/nuget/chocolatey + choco source enable --name artifactory + choco source disable --name chocolatey + + if (!((choco list habitat --local-only) -match '^1 packages installed\.$')) { choco install habitat -y } From 5a9f1b3b8d0e699b4f49ce8534eae81505615c54 Mon Sep 17 00:00:00 2001 From: Scott Hain Date: Thu, 30 May 2019 09:19:10 -0700 Subject: [PATCH 2/5] Selectively disable failing docker tests" Signed-off-by: Scott Hain --- .expeditor/verify.pipeline.yml | 77 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index d6fb703609..cfc1451756 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -49,12 +49,12 @@ steps: - .\test\run_clippy.ps1 stable .\test\unexamined_lints.txt .\test\allowed_lints.txt .\test\lints_to_fix.txt .\test\denied_lints.txt agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 25 ####################################################################### @@ -410,12 +410,13 @@ steps: - ./test/run_cargo_test.ps1 butterfly -Nightly -Features "lock_as_rwlock deadlock_detection" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # TODO: enable once we've figured out why this fails in docker + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -458,12 +459,13 @@ steps: - ./test/run_cargo_test.ps1 core agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # TODO: enable once we've figured out why this fails in docker + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -474,12 +476,13 @@ steps: - ./test/run_cargo_test.ps1 hab agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # TODO: enable once we've figured out why this fails in docker + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -635,12 +638,13 @@ steps: - ./test/run_cargo_test.ps1 sup-protocol agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # TODO: enable once we've figured out why this fails in docker + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -651,12 +655,13 @@ steps: - ./test/run_studio_test.ps1 "studio-from-source" agents: queue: 'default-windows-privileged' - plugins: - docker#v3.2.0: - image: "chefes/buildkite-windows" - shell: [ "powershell", "-Command" ] - always-pull: true - propagate-environment: true + # TODO: enable once we've figured out why this fails in docker + # plugins: + # docker#v3.2.0: + # image: "chefes/buildkite-windows" + # shell: [ "powershell", "-Command" ] + # always-pull: true + # propagate-environment: true timeout_in_minutes: 5 retry: automatic: From ee7497d0d0fb13271349c06828f753ea5a5a4dc1 Mon Sep 17 00:00:00 2001 From: mwrock Date: Mon, 3 Jun 2019 12:32:49 -0700 Subject: [PATCH 3/5] only use choco artifactory source on buildkite Signed-off-by: mwrock --- support/ci/shared.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/support/ci/shared.ps1 b/support/ci/shared.ps1 index 445daed066..53353842a4 100644 --- a/support/ci/shared.ps1 +++ b/support/ci/shared.ps1 @@ -50,10 +50,11 @@ function Install-Habitat { Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | out-null } - choco source Add -Name artifactory -Source http://artifactory-preprod.chef.co/api/nuget/chocolatey - choco source enable --name artifactory - choco source disable --name chocolatey - + if($env:BUILDKITE) { + choco source Add -Name artifactory -Source http://artifactory-preprod.chef.co/api/nuget/chocolatey + choco source enable --name artifactory + choco source disable --name chocolatey + } if (!((choco list habitat --local-only) -match '^1 packages installed\.$')) { choco install habitat -y From 96bc4c45a79f4141cfb5c159951f51374a9ae0d8 Mon Sep 17 00:00:00 2001 From: mwrock Date: Wed, 5 Jun 2019 15:15:27 -0700 Subject: [PATCH 4/5] make clippy and all tests windows docker friendly Signed-off-by: mwrock --- .expeditor/verify.pipeline.yml | 97 +++++++++---------- build.ps1 | 2 +- components/core/src/fs.rs | 25 +++-- .../hab/src/command/bldr/job/promote.rs | 21 ---- components/sup-protocol/build.rs | 26 +---- support/ci/shared.ps1 | 6 +- test/run_studio_test.ps1 | 8 ++ 7 files changed, 71 insertions(+), 114 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index cfc1451756..27a435c4ce 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -49,13 +49,13 @@ steps: - .\test\run_clippy.ps1 stable .\test\unexamined_lints.txt .\test\allowed_lints.txt .\test\lints_to_fix.txt .\test\denied_lints.txt agents: queue: 'default-windows-privileged' - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true - timeout_in_minutes: 25 + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true + timeout_in_minutes: 40 ####################################################################### # Unit Tests - Linux! @@ -402,7 +402,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 20 + timeout_in_minutes: 25 soft_fail: true - label: "[unit] :windows: butterfly lock_as_rwlock" @@ -410,14 +410,13 @@ steps: - ./test/run_cargo_test.ps1 butterfly -Nightly -Features "lock_as_rwlock deadlock_detection" -TestOptions "--test-threads=1" agents: queue: 'default-windows-privileged' - # TODO: enable once we've figured out why this fails in docker - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true - timeout_in_minutes: 20 + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true + timeout_in_minutes: 40 retry: automatic: limit: 1 @@ -435,7 +434,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 20 + timeout_in_minutes: 25 soft_fail: true - label: "[unit] :windows: common" @@ -449,7 +448,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 20 + timeout_in_minutes: 25 retry: automatic: limit: 1 @@ -459,13 +458,12 @@ steps: - ./test/run_cargo_test.ps1 core agents: queue: 'default-windows-privileged' - # TODO: enable once we've figured out why this fails in docker - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -476,14 +474,13 @@ steps: - ./test/run_cargo_test.ps1 hab agents: queue: 'default-windows-privileged' - # TODO: enable once we've figured out why this fails in docker - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true - timeout_in_minutes: 20 + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true + timeout_in_minutes: 25 retry: automatic: limit: 1 @@ -515,7 +512,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 10 + timeout_in_minutes: 20 retry: automatic: limit: 1 @@ -531,7 +528,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 10 + timeout_in_minutes: 20 retry: automatic: limit: 1 @@ -547,7 +544,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true - timeout_in_minutes: 20 + timeout_in_minutes: 25 retry: automatic: limit: 1 @@ -638,13 +635,12 @@ steps: - ./test/run_cargo_test.ps1 sup-protocol agents: queue: 'default-windows-privileged' - # TODO: enable once we've figured out why this fails in docker - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 20 retry: automatic: @@ -655,13 +651,12 @@ steps: - ./test/run_studio_test.ps1 "studio-from-source" agents: queue: 'default-windows-privileged' - # TODO: enable once we've figured out why this fails in docker - # plugins: - # docker#v3.2.0: - # image: "chefes/buildkite-windows" - # shell: [ "powershell", "-Command" ] - # always-pull: true - # propagate-environment: true + plugins: + docker#v3.2.0: + image: "chefes/buildkite-windows" + shell: [ "powershell", "-Command" ] + always-pull: true + propagate-environment: true timeout_in_minutes: 5 retry: automatic: @@ -872,6 +867,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true + timeout_in_minutes: 40 retry: automatic: limit: 1 @@ -926,6 +922,7 @@ steps: shell: [ "powershell", "-Command" ] always-pull: true propagate-environment: true + timeout_in_minutes: 40 retry: automatic: limit: 1 diff --git a/build.ps1 b/build.ps1 index 21045293f8..40d2a530d7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -87,7 +87,7 @@ function Invoke-Build([string]$Path, [switch]$Clean, [string]$Command, [switch]$ Install-RustToolchain $toolchain rustup component add --toolchain $Toolchain rustfmt Setup-Environment - Invoke-Expression "cargo +$ToolChain $Command --all -- --check" + Invoke-Expression "cargo +$ToolChain $Command --all" break } "clippy" { diff --git a/components/core/src/fs.rs b/components/core/src/fs.rs index 53e3776f5a..c53cfda7a9 100644 --- a/components/core/src/fs.rs +++ b/components/core/src/fs.rs @@ -450,10 +450,10 @@ impl<'a> SvcDir<'a> { /// ``` /// use habitat_core::fs::find_command; /// use std::{env, -/// fs}; +/// path::PathBuf}; /// -/// let first_path = fs::canonicalize("./tests/fixtures").unwrap(); -/// let second_path = fs::canonicalize("./tests/fixtures/bin").unwrap(); +/// let first_path = PathBuf::from("tests/fixtures"); +/// let second_path = PathBuf::from("tests/fixtures/bin"); /// let path_bufs = vec![first_path, second_path]; /// let new_path = env::join_paths(path_bufs).unwrap(); /// env::set_var("PATH", &new_path); @@ -467,10 +467,10 @@ impl<'a> SvcDir<'a> { /// ``` /// use habitat_core::fs::find_command; /// use std::{env, -/// fs}; +/// path::PathBuf}; /// -/// let first_path = fs::canonicalize("./tests/fixtures").unwrap(); -/// let second_path = fs::canonicalize("./tests/fixtures/bin").unwrap(); +/// let first_path = PathBuf::from("tests/fixtures"); +/// let second_path = PathBuf::from("tests/fixtures/bin"); /// let path_bufs = vec![first_path, second_path]; /// let new_path = env::join_paths(path_bufs).unwrap(); /// env::set_var("PATH", &new_path); @@ -803,7 +803,6 @@ mod test_find_command { pub use super::find_command; use std::{env, - fs, path::PathBuf}; #[allow(dead_code)] @@ -822,8 +821,8 @@ mod test_find_command { fn setup_path() { let orig_path = env::var_os("PATH").unwrap(); let mut os_paths: Vec = env::split_paths(&orig_path).collect(); - let first_path = fs::canonicalize("./tests/fixtures").unwrap(); - let second_path = fs::canonicalize("./tests/fixtures/bin").unwrap(); + let first_path = PathBuf::from("tests/fixtures"); + let second_path = PathBuf::from("tests/fixtures/bin"); let mut path_bufs = vec![first_path, second_path]; path_bufs.append(&mut os_paths); let new_path = env::join_paths(path_bufs).unwrap(); @@ -869,7 +868,7 @@ mod test_find_command { mod argument_with_extension { use super::{find_command, setup_environment}; - use std::fs::canonicalize; + use std::path::PathBuf; #[test] fn command_exists() { @@ -895,7 +894,7 @@ mod test_find_command { #[test] fn first_command_on_path_found() { setup_environment(); - let target_path = canonicalize("./tests/fixtures/plan.sh").unwrap(); + let target_path = PathBuf::from("tests/fixtures/plan.sh"); let result = find_command("plan.sh"); let found_path = result.unwrap(); assert_eq!(found_path, target_path); @@ -952,7 +951,7 @@ mod test_find_command { mod argument_with_extension { use super::{find_command, setup_environment}; - use std::fs::canonicalize; + use std::path::PathBuf; #[test] fn command_exists() { @@ -978,7 +977,7 @@ mod test_find_command { #[test] fn first_command_on_path_found() { setup_environment(); - let target_path = canonicalize("./tests/fixtures/plan.sh").unwrap(); + let target_path = PathBuf::from("tests/fixtures/plan.sh"); let result = find_command("plan.sh"); let found_path = result.unwrap(); assert_eq!(found_path, target_path); diff --git a/components/hab/src/command/bldr/job/promote.rs b/components/hab/src/command/bldr/job/promote.rs index a8864e2370..c4a37dd838 100644 --- a/components/hab/src/command/bldr/job/promote.rs +++ b/components/hab/src/command/bldr/job/promote.rs @@ -229,25 +229,4 @@ mod test { ["core/project1/1.0.0/20180101000000", "core/project2/1.0.0/20180101000000",]) } - - #[test] - fn test_get_ident_list_interactive() { - let (mut ui, _stdout, _stderr) = ui(); - let group_status = SchedulerResponse { id: "12345678".to_string(), - state: "Finished".to_string(), - projects: sample_project_list(), - created_at: - "Properly formated timestamp".to_string(), - project_name: "Test Project".to_string(), - target: "x86_64-linux".to_string(), }; - env::set_var("EDITOR", "cat"); - - let ident_list = - get_ident_list(&mut ui, &group_status, Some("core"), true).expect("Error fetching \ - ident list"); - - assert_eq!(ident_list, - ["core/project1/1.0.0/20180101000000", - "core/project2/1.0.0/20180101000000",]) - } } diff --git a/components/sup-protocol/build.rs b/components/sup-protocol/build.rs index aa9f409759..a35bfb3745 100644 --- a/components/sup-protocol/build.rs +++ b/components/sup-protocol/build.rs @@ -37,24 +37,6 @@ fn generate_protocols() { config.compile_protos(&protocol_files(), &protocol_includes()) .expect("protocols"); compile_proto_impls(&protocol_files(), &protocol_includes()).expect("protocol-impls"); - for file in generated_files() { - fs::rename(&file, - format!("src/generated/{}", - file.file_name().unwrap().to_string_lossy())).unwrap(); - } -} - -fn generated_files() -> Vec { - let mut files = vec![]; - for entry in fs::read_dir(env::var("OUT_DIR").unwrap()).unwrap() { - let file = entry.unwrap(); - if file.file_name().to_str().unwrap().ends_with(".rs") { - if file.metadata().unwrap().is_file() { - files.push(file.path()); - } - } - } - files } fn protocol_files() -> Vec { @@ -77,13 +59,7 @@ fn protocol_includes() -> Vec { vec!["protocols".to_string()] } fn compile_proto_impls

(protos: &[P], includes: &[P]) -> Result<()> where P: AsRef { - let target: PathBuf = env::var_os("OUT_DIR").ok_or_else(|| { - Error::new(ErrorKind::Other, - "OUT_DIR environment variable is \ - not set") - })? - .into(); - + let target = PathBuf::from("src/generated"); let tmp = tempfile::TempDir::new()?; let descriptor_set = tmp.path().join("prost-descriptor-set"); diff --git a/support/ci/shared.ps1 b/support/ci/shared.ps1 index 53353842a4..d14d851a9b 100644 --- a/support/ci/shared.ps1 +++ b/support/ci/shared.ps1 @@ -19,6 +19,8 @@ function Install-Rustup($Toolchain) { if (get-command -Name rustup.exe -ErrorAction SilentlyContinue) { Write-Host "rustup is currently installed" + rustup set default-host x86_64-pc-windows-msvc + rustup default stable-x86_64-pc-windows-msvc } else { Write-Host "Installing rustup and $toolchain-x86_64-pc-windows-msvc Rust." [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 @@ -141,10 +143,6 @@ function Setup-Environment { # On buildkite, the rust binaries will be directly in C: if($env:BUILDKITE) { - $env:CARGO_HOME="C:\rust\.cargo" - $env:path = New-PathString -StartingPath $env:path -Path "C:\rust\.cargo\bin" # this will avoid a path length limit from the long buildkite working dir path $env:CARGO_TARGET_DIR = "c:\target" - $env:RUSTUP_HOME="C:\rust\.rustup" - $env:path = New-PathString -StartingPath $env:path -Path "C:\rust\.rustup\bin" } diff --git a/test/run_studio_test.ps1 b/test/run_studio_test.ps1 index 5e7a7882f3..6a56ce61d4 100644 --- a/test/run_studio_test.ps1 +++ b/test/run_studio_test.ps1 @@ -6,6 +6,14 @@ param ( $ErrorActionPreference="stop" +. $PSScriptRoot\..\support\ci\shared.ps1 +Install-Habitat + +if(!(Get-PackageProvider -Name nuget -ErrorAction SilentlyContinue -ListAvailable)) { + Write-Host "Installing Nuget provider..." + Install-PackageProvider -Name NuGet -Force | Out-Null +} + if(!(Get-Module Await -ListAvailable)) { Write-Host "Installing Await PS Module..." Install-Module Await -Force | Out-Null From 48f60f572cdecbe5b6c25cbaf8986a0b536f658f Mon Sep 17 00:00:00 2001 From: Scott Hain Date: Thu, 6 Jun 2019 10:09:58 -0700 Subject: [PATCH 5/5] Don't use artifactory mirror Signed-off-by: Scott Hain --- support/ci/shared.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/support/ci/shared.ps1 b/support/ci/shared.ps1 index d14d851a9b..7bcd83d676 100644 --- a/support/ci/shared.ps1 +++ b/support/ci/shared.ps1 @@ -52,12 +52,6 @@ function Install-Habitat { Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | out-null } - if($env:BUILDKITE) { - choco source Add -Name artifactory -Source http://artifactory-preprod.chef.co/api/nuget/chocolatey - choco source enable --name artifactory - choco source disable --name chocolatey - } - if (!((choco list habitat --local-only) -match '^1 packages installed\.$')) { choco install habitat -y }