Skip to content

Commit

Permalink
Adding env variable for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyHuynh1 committed Oct 2, 2023
1 parent 6546bcb commit 5520909
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dynamic-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/api/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> for PollInterval {
type Error = Report<ValidationError>;
Expand Down
6 changes: 4 additions & 2 deletions tests/it/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5520909

Please sign in to comment.