Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some code cleanups after #5866 #6077

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
UNAME_S := $(shell uname -s)
HAS_DOCKER := $(shell command -v docker 2> /dev/null)
TESTING_FS_ROOT := $(shell mktemp -d /tmp/testing-fs-root-XXXXXX)
ifneq (${IN_DOCKER},)
IN_DOCKER := ${IN_DOCKER}
else ifeq ($(UNAME_S),Darwin)
Expand Down Expand Up @@ -186,7 +187,7 @@ $(foreach component,$(ALL),$(eval $(call BUILD,$(component))))

define UNIT
unit-$1: image ## executes the $1 component's unit test suite
$(run) sh -c 'cd components/$1 && cargo test $(CARGO_FLAGS)'
$(run) sh -c 'cd components/$1 && TESTING_FS_ROOT=$(TESTING_FS_ROOT) cargo test $(CARGO_FLAGS)'
.PHONY: unit-$1
endef
$(foreach component,$(ALL),$(eval $(call UNIT,$(component))))
Expand Down
12 changes: 5 additions & 7 deletions components/common/src/templating/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ fn never_escape(data: &str) -> String {

#[cfg(test)]
mod test {
use super::*;
use crate::hcore::fs::{pkg_root_path, FS_ROOT_PATH};
use crate::hcore::package::PackageIdent;
use crate::templating::test_helpers::*;
use serde_json;
use std::collections::BTreeMap;
use std::env;
Expand All @@ -127,12 +131,6 @@ mod test {
use tempfile::TempDir;
use toml;

use crate::hcore::fs::FS_ROOT_PATH;
use crate::hcore::package::PackageIdent;

use super::*;
use crate::templating::test_helpers::*;

pub fn root() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests")
}
Expand Down Expand Up @@ -309,7 +307,7 @@ test: something"#
let rendered = renderer.render("t", &data).unwrap();
assert_eq!(
PathBuf::from(rendered),
(&*FS_ROOT_PATH).join("/hab/pkgs/core/acl/2.2.52/20161208223311",)
pkg_root_path(Some(&*FS_ROOT_PATH)).join("core/acl/2.2.52/20161208223311",)
);
}

Expand Down
2 changes: 0 additions & 2 deletions components/pkg-export-kubernetes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use base64;
use clap;
use habitat_common as common;
use habitat_core as hcore;
use habitat_pkg_export_docker as export_docker;
use handlebars;

#[macro_use]
extern crate serde_json;
Expand Down
1 change: 0 additions & 1 deletion components/sup-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use habitat_core as core;
extern crate lazy_static;
#[macro_use]
extern crate log;
use prost;
#[macro_use]
extern crate prost_derive;

Expand Down
1 change: 0 additions & 1 deletion components/sup/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern crate habitat_core as hcore;

#[macro_use]
extern crate lazy_static;
use rand;

mod utils;

Expand Down
3 changes: 0 additions & 3 deletions support/ci/rust_tests.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

sudo mkdir -p /hab
sudo chmod o+w /hab
jamesc marked this conversation as resolved.
Show resolved Hide resolved

git log HEAD~1..HEAD | grep -q '!!! Temporary Commit !!!'
is_tmp_commit=$?

Expand Down
Binary file removed ubuntu@54.188.146.158
Binary file not shown.