diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index cfc1451756..6384fc7dd8 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 ####################################################################### @@ -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..5d2440936d 100644 --- a/components/sup-protocol/build.rs +++ b/components/sup-protocol/build.rs @@ -38,9 +38,11 @@ fn generate_protocols() { .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(); + fs::copy(&file, + format!("src/generated/{}", + file.file_name().unwrap().to_string_lossy())).expect("unable to copy \ + generated file"); + fs::remove_file(&file).unwrap(); } } 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