From a4f9b7cd1ebb6ce7fb797acdb27caf9e3cfa1e46 Mon Sep 17 00:00:00 2001 From: Hiroaki Goto Date: Fri, 29 Nov 2024 02:42:37 +0900 Subject: [PATCH] test: use dummy credential when executing tests Signed-off-by: Hiroaki Goto --- .github/workflows/ci.yml | 6 ------ tests/util/mod.rs | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cf4964..648a5b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: RUST_LOG: debug # Output debug log RUST_BACKTRACE: 1 # Dump backtrace on panic DYNEIN_TEST_NO_DOCKER_SETUP: true - # define AWS credentials in environment for test - AWS_ACCESS_KEY_ID: test - AWS_SECRET_ACCESS_KEY: test services: dynamodb: # Pinned to the version not to be broken with latest @@ -54,9 +51,6 @@ jobs: RUST_LOG: debug # Output debug log RUST_BACKTRACE: 1 # Dump backtrace on panic DYNEIN_TEST_NO_DOCKER_SETUP: true - # define AWS credentials in environment for test - AWS_ACCESS_KEY_ID: test - AWS_SECRET_ACCESS_KEY: test steps: - uses: actions/checkout@v4 - name: Install rust toolchain diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 2395ee6..da3d3ee 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -72,7 +72,11 @@ impl<'a> TestManager<'a> { pub fn command(&self) -> Result> { let mut c = Command::cargo_bin("dy")?; - c.env("DYNEIN_CONFIG_DIR", &self.default_config_dir); + c.envs([ + ("DYNEIN_CONFIG_DIR", &self.default_config_dir), + ("AWS_ACCESS_KEY_ID", &PathBuf::from("test")), + ("AWS_SECRET_ACCESS_KEY", &PathBuf::from("test")), + ]); Ok(c) }