Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #775 from thedavidmeister/2018-12-18-appveyor
Browse files Browse the repository at this point in the history
swarm travis
  • Loading branch information
zippy authored Dec 19, 2018
2 parents 9362051 + b91f889 commit e0b3d35
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 26 deletions.
215 changes: 199 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,208 @@ _cmd_deploy_template: &_cmd_deploy_template
tags: true
name: $TRAVIS_TAG

env:
global:
- LIBZMQ_PREFIX=C:\\Users\\travis\\build\\holochain\\holochain-rust\\vendor\\zmq

_windows_template_lite: &_windows_template_lite
os: windows
language: rust
rust: nightly-2018-11-28-x86_64-pc-windows-msvc
before_install:
- PATH=$PATH:$TRAVIS_BUILD_DIR/vendor/zmq/bin
- CARGO_INCREMENTAL=1
- RUSTFLAGS="-Z thinlto -C codegen-units=16"
cache:
timeout: 1000
directories:
# only keep target directories
# as we don't keep .cargo everything will be redownloaded every time
# as travis downloads the cache every time, this doesn't make much
# difference, actually it can be a bit faster or slightly slower to pull
# the crates down vs. loading the cache - seems to be an overall benefit
# as we do CARGO_INCREMENTAL and keep the targets, the newly downloaded
# crates don't recompile, so we save *a lot* of time there
- target
- $CARGO_TARGET_DIR
- $WASM_TARGET_DIR
install:
# "none" is a hack here to avoid "" ending up in the cache, potentially
# caching everything in the repo (we never want to accidentally do that)
- if [ $WASM_PATH != "none" ]; then rustup target add wasm32-unknown-unknown; fi;
- if [ $WASM_PATH != "none" ]; then cargo build --manifest-path $WASM_PATH/Cargo.toml --release --target wasm32-unknown-unknown --target-dir $WASM_TARGET_DIR; fi;
script:
- cargo test -p $TEST_P --target-dir $CARGO_TARGET_DIR

jobs:
# test builds are ordered from slowest to quickest
# this allows us to keep walltimes down
include:
- name: "windows build & test all"
<<: *_windows_template
- name: "windows hdk"
<<: *_windows_template_lite
env:
- NODIST_PREFIX="/c/Program Files (x86)\Nodist"
- NODIST_X64=1
- TRAVIS_NODE_VERSION=8
- LIBZMQ_PREFIX=C:\\Users\\travis\\build\\holochain\\holochain-rust\\vendor\\zmq
install:
- rustup target add wasm32-unknown-unknown
script:
# Build WASMs
- cargo build --manifest-path core/src/nucleus/actions/wasm-test/Cargo.toml --release --target wasm32-unknown-unknown
- cargo build --manifest-path container_api/wasm-test/Cargo.toml --release --target wasm32-unknown-unknown
- cargo build --manifest-path hdk-rust/wasm-test/Cargo.toml --release --target wasm32-unknown-unknown
- cargo build --manifest-path wasm_utils/wasm-test/integration-test/Cargo.toml --release --target wasm32-unknown-unknown
# Build & test All
- cargo test --all
- TEST_P=hdk
- TEST_PATH=hdk-rust
- WASM_PATH=hdk-rust/wasm-test
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows wasm_utils"
<<: *_windows_template_lite
env:
- TEST_P=holochain_wasm_utils
- TEST_PATH=wasm_utils
- WASM_PATH=wasm_utils/wasm-test/integration-test
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows container_api"
<<: *_windows_template_lite
env:
- TEST_P=holochain_container_api
- TEST_PATH=container_api
- WASM_PATH=container_api/wasm-test
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows core"
<<: *_windows_template_lite
env:
- TEST_P=holochain_core
- TEST_PATH=core
- WASM_PATH=core/src/nucleus/actions/wasm-test
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

# contains no tests
# quick to build, good for basic debugging
# @see https://travis-ci.com/holochain/holochain-rust/jobs/166081895
# - name: "windows core_types_derive"
# <<: *_windows_template_lite
# env:
# - TEST_P=holochain_core_types_derive
# - TEST_PATH=core_types_derive
# - CARGO_TARGET_DIR=$TEST_PATH/target

- name: "windows holochain_cas_implementations"
<<: *_windows_template_lite
env:
- TEST_P=holochain_cas_implementations
- TEST_PATH=cas_implementations
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows dna_c_binding"
<<: *_windows_template_lite
env:
- TEST_P=holochain_dna_c_binding
- TEST_PATH=dna_c_binding
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows holochain_net_connection"
<<: *_windows_template_lite
env:
- TEST_P=holochain_net_connection
- TEST_PATH=net_connection
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows holochain_sodium"
<<: *_windows_template_lite
env:
- TEST_P=holochain_sodium
- TEST_PATH=sodium
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows hc"
<<: *_windows_template_lite
env:
- TEST_P=hc
- TEST_PATH=cmd
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

# no tests
# https://travis-ci.com/holochain/holochain-rust/jobs/166086955
# - name: "windows holochain_container"
# <<: *_windows_template_lite
# env:
# - TEST_P=holochain_container
# - TEST_PATH=container
# - WASM_PATH=none
# # boilerplate
# - CARGO_TARGET_DIR=$TEST_PATH/target
# - WASM_TARGET_DIR=$WASM_PATH/target

# no tests
# https://travis-ci.com/holochain/holochain-rust/jobs/166086957
# - name: "windows core_api_c_binding"
# <<: *_windows_template_lite
# env:
# - TEST_P=holochain_core_api_c_binding
# - TEST_PATH=core_api_c_binding
# - WASM_PATH=none
# # boilerplate
# - CARGO_TARGET_DIR=$TEST_PATH/target
# - WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows core_types"
<<: *_windows_template_lite
env:
- TEST_P=holochain_core_types
- TEST_PATH=core_types
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows holochain_net"
<<: *_windows_template_lite
env:
- TEST_P=holochain_net
- TEST_PATH=net
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

- name: "windows holochain_net_ipc"
<<: *_windows_template_lite
env:
- TEST_P=holochain_net_ipc
- TEST_PATH=net_ipc
- WASM_PATH=none
# boilerplate
- CARGO_TARGET_DIR=$TEST_PATH/target
- WASM_TARGET_DIR=$WASM_PATH/target

# no tests
# https://travis-ci.com/holochain/holochain-rust/jobs/166086961
# - name: "windows holochain_test_bin"
# <<: *_windows_template_lite
# env:
# - TEST_P=holochain_test_bin
# - TEST_PATH=test_bin
# - WASM_PATH=none
# # boilerplate
# - CARGO_TARGET_DIR=$TEST_PATH/target
# - WASM_TARGET_DIR=$WASM_PATH/target

- name: "C binding tests"
<<: *_trusty_bash
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ or
make fmt
```


#### Compiler warnings

Compilation warnings are NOT OK in shared/production level code.
Expand Down
3 changes: 2 additions & 1 deletion cmd/src/cli/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ fn scaffold<S: Scaffold>(tooling: &S, base_path: PathBuf) -> DefaultResult<()> {
}

#[cfg(test)]
// too slow!
#[cfg(feature = "broken-tests")]
mod tests {
use assert_cmd::prelude::*;
use std::process::Command;
Expand All @@ -81,7 +83,6 @@ mod tests {
}

#[test]
#[cfg(not(windows))]
fn can_generate_scaffolds() {
let tmp = gen_dir();

Expand Down
2 changes: 1 addition & 1 deletion cmd/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod init;
pub mod package;
mod run;
mod scaffold;
mod test;
pub mod test;
mod test_context;

pub use self::{
Expand Down
6 changes: 2 additions & 4 deletions cmd/src/cli/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ fn unpack_recurse(mut obj: Object, to: &PathBuf) -> DefaultResult<()> {
}

#[cfg(test)]
// too slow!
#[cfg(feature = "broken-tests")]
mod tests {
use super::*;
use assert_cmd::prelude::*;
use std::process::Command;
use tempfile::{Builder, TempDir};
Expand All @@ -305,7 +306,6 @@ mod tests {
}

#[test]
#[cfg(not(windows))]
fn package_and_unpack_isolated() {
const DEFAULT_BUNDLE_FILE_NAME: &str = "bundle.json";

Expand Down Expand Up @@ -355,7 +355,6 @@ mod tests {
}

#[test]
#[cfg(not(windows))]
/// A test ensuring that packaging and unpacking a project results in the very same project
fn package_reverse() {
const DEFAULT_BUNDLE_FILE_NAME: &str = "bundle.json";
Expand Down Expand Up @@ -407,7 +406,6 @@ mod tests {
}

#[test]
#[cfg(not(windows))]
fn auto_compilation() {
let tmp = gen_dir();

Expand Down
9 changes: 8 additions & 1 deletion cmd/src/cli/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,28 @@ pub fn test(
}

#[cfg(test)]
#[cfg(feature = "broken-tests")]
pub mod tests {
use super::*;
use crate::cli::package;
use assert_cmd::prelude::*;
use std::process::Command;
use tempfile::{Builder, TempDir};

#[cfg(feature = "broken-tests")]
const HOLOCHAIN_TEST_PREFIX: &str = "org.holochain.test";

fn gen_dir() -> TempDir {
#[cfg(feature = "broken-tests")]
pub fn gen_dir() -> TempDir {
Builder::new()
.prefix(HOLOCHAIN_TEST_PREFIX)
.tempdir()
.unwrap()
}

#[test]
// flagged as broken for taking 60+ seconds
#[cfg(feature = "broken-tests")]
fn test_command_basic_test() {
let temp_space = gen_dir();
let temp_dir_path = temp_space.path();
Expand Down Expand Up @@ -107,6 +112,8 @@ pub mod tests {
}

#[test]
// flagged broken for taking 60+ seconds to run
#[cfg(feature = "broken-tests")]
fn test_command_no_test_folder() {
let temp_space = gen_dir();
let temp_dir_path = temp_space.path();
Expand Down
2 changes: 2 additions & 0 deletions core/src/workflows/hold_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ pub async fn hold_entry_workflow<'a>(
}

#[cfg(test)]
// too slow!
#[cfg(feature = "broken-tests")]
pub mod tests {
use super::*;
use crate::{
Expand Down
2 changes: 2 additions & 0 deletions core/src/workflows/hold_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub async fn hold_link_workflow<'a>(
}

#[cfg(test)]
// too slow!
#[cfg(feature = "broken-tests")]
pub mod tests {
use super::*;
use crate::{
Expand Down
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let
hc-test = nixpkgs.writeShellScriptBin "hc-test"
''
hc-build
cargo test --all --exclude hc;
cargo test --release --all --exclude hc;
'';

hc-install-node-container = nixpkgs.writeShellScriptBin "hc-install-node-container"
Expand Down Expand Up @@ -129,7 +129,7 @@ stdenv.mkDerivation rec {
# https://github.com/rust-unofficial/patterns/blob/master/anti_patterns/deny-warnings.md
# https://llogiq.github.io/2017/06/01/perf-pitfalls.html
# RUSTFLAGS = "-D warnings -Z external-macro-backtrace --cfg procmacro2_semver_exempt -C lto=no -Z incremental-info";
RUSTFLAGS = "-D warnings -Z external-macro-backtrace --cfg procmacro2_semver_exempt";
RUSTFLAGS = "-D warnings -Z external-macro-backtrace --cfg procmacro2_semver_exempt -Z thinlto -C codegen-units=16";
# CARGO_INCREMENTAL = "1";
# https://github.com/rust-lang/cargo/issues/4961#issuecomment-359189913
# RUST_LOG = "info";
Expand Down

0 comments on commit e0b3d35

Please sign in to comment.