From 5520909ea7c958589f8b40e1820f46e7a7a8c1ad Mon Sep 17 00:00:00 2001 From: Jeffrey Huynh Date: Mon, 2 Oct 2023 10:54:41 -0600 Subject: [PATCH] Adding env variable for integration tests --- .github/workflows/dynamic-analysis.yml | 2 ++ src/api/remote.rs | 2 +- tests/it/helper.rs | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dynamic-analysis.yml b/.github/workflows/dynamic-analysis.yml index 423ea925..15f6b8ef 100644 --- a/.github/workflows/dynamic-analysis.yml +++ b/.github/workflows/dynamic-analysis.yml @@ -32,6 +32,8 @@ jobs: - run: cargo nextest run env: RUN_INTEGRATION_TESTS: "1" + # This key is used for integration tests + FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} # nextest doesn't run doctests, but does test everything else: https://github.com/nextest-rs/nextest/issues/16 # run doctests after; this won't result in any extra rebuilds and is very quick. # doctest overview: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html diff --git a/src/api/remote.rs b/src/api/remote.rs index 398cbf24..a3af1fa0 100644 --- a/src/api/remote.rs +++ b/src/api/remote.rs @@ -196,7 +196,7 @@ impl PollInterval { /// This is set because Broker is intended to bring eventual observability; /// if users want faster polling than this it's probably because they want to make sure they don't miss revisions, /// in such a case we recommend CI integration. -pub const MIN_POLL_INTERVAL: Duration = Duration::from_secs(15); +pub const MIN_POLL_INTERVAL: Duration = Duration::from_secs(60 * 60); impl TryFrom for PollInterval { type Error = Report; diff --git a/tests/it/helper.rs b/tests/it/helper.rs index 4348fb92..da2a854e 100644 --- a/tests/it/helper.rs +++ b/tests/it/helper.rs @@ -40,16 +40,18 @@ macro_rules! temp_config { () => {{ let tmp = tempfile::tempdir().expect("must create tempdir"); let dir = tmp.path().join("debug"); + let fossa_key = std::env::var("FOSSA_API_KEY").expect("test"); + let content = indoc::formatdoc! {r#" fossa_endpoint: https://app.fossa.com - fossa_integration_key: abcd1234 + fossa_integration_key: {} version: 1 debugging: location: {dir:?} retention: days: 1 integrations: - "#}; + "#, fossa_key }; let path = tmp.path().join("config.yml"); std::fs::write(&path, content).expect("must write config file");