diff options
author | Neil Kistner <neil.kistner@gmail.com> | 2019-09-09 18:14:38 -0500 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-09 19:14:38 -0400 |
commit | 9f70ffb7a7d2eeef64c360c553e909d38e44adf0 (patch) | |
tree | 4dccf8a935e027dcf7bc77781eed1554a645d72a /tests/testsuite/golang.rs | |
parent | dc8409333e194624896c74c5e5cdb4f664f53f9d (diff) |
fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
Diffstat (limited to 'tests/testsuite/golang.rs')
-rw-r--r-- | tests/testsuite/golang.rs | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/tests/testsuite/golang.rs b/tests/testsuite/golang.rs index b5d37bc1f..a2c50e72c 100644 --- a/tests/testsuite/golang.rs +++ b/tests/testsuite/golang.rs @@ -2,7 +2,7 @@ use ansi_term::Color; use std::fs::{self, File}; use std::io; -use crate::common::{self, TestCommand}; +use crate::common; #[test] fn folder_without_go_files() -> io::Result<()> { @@ -138,24 +138,3 @@ fn folder_with_gopkg_lock() -> io::Result<()> { assert_eq!(expected, actual); Ok(()) } - -#[test] -#[ignore] -fn config_disabled() -> io::Result<()> { - let dir = common::new_tempdir()?; - File::create(dir.path().join("main.go"))?; - - let output = common::render_module("golang") - .use_config(toml::toml! { - [golang] - disabled = true - }) - .arg("--path") - .arg(dir.path()) - .output()?; - let actual = String::from_utf8(output.stdout).unwrap(); - - let expected = ""; - assert_eq!(expected, actual); - Ok(()) -} |