Skip to content

Commit dbafe48

Browse files
authored
Merge pull request #334 from obeli-sk/local-should-work
Switch to test.sh, test-js-local.sh
2 parents 5b7501b + 181bd01 commit dbafe48

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

.github/workflows/check-test.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
matrix:
3232
include:
3333
- report: junit-default.xml
34-
additional: ""
34+
script: "scripts/test.sh"
3535
- report: junit-js-local.xml
36-
additional: "-F activity-js-local -F workflow-js-local"
36+
script: "scripts/test-js-local.sh"
3737

3838
steps:
3939
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -56,22 +56,14 @@ jobs:
5656
- name: Build tests
5757
run: nix develop --command cargo nextest run --workspace --no-run
5858

59-
- name: Populate the codegen cache
60-
run: nix develop --command scripts/test-phase1.sh
59+
- name: Run tests
60+
run: nix develop --command ${{ matrix.script }}
6161
env:
62-
CI: true
63-
ADDITIONAL_FEATURES: "${{ matrix.additional }}"
64-
65-
- name: test
66-
run: nix develop --command scripts/test-phase2.sh
67-
env:
68-
RUST_LOG: "info,executor=trace,wasm_workers=trace,db=info"
6962
CI: true
7063
TEST_POSTGRES_HOST: "localhost"
7164
TEST_POSTGRES_USER: "postgres"
7265
TEST_POSTGRES_PASSWORD: "postgres"
7366
TEST_POSTGRES_DATABASE_PREFIX: "obelisk_test"
74-
ADDITIONAL_FEATURES: "${{ matrix.additional }}"
7567

7668
- name: Rename test report
7769
run: mv target/nextest/ci-test/junit.xml target/nextest/ci-test/${{ matrix.report }}

src/command/server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,7 @@ async fn fetch_webhook_js_runtime(
20882088

20892089
/// Fetch the webhook-js runtime WASM from OCI.
20902090
#[cfg(not(feature = "webhook-js-local"))]
2091+
#[instrument(skip_all)]
20912092
async fn fetch_webhook_js_runtime(
20922093
wasm_cache_dir: Arc<Path>,
20932094
metadata_dir: Arc<Path>,

src/config/toml.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::{
2929
sync::Arc,
3030
time::Duration,
3131
};
32-
use tracing::{info, instrument, trace, warn};
32+
use tracing::{debug, info, instrument, trace, warn};
3333
use utils::wasm_tools::WasmComponent;
3434
use wasm_workers::http_request_policy::HostPatternError;
3535
use wasm_workers::{
@@ -513,12 +513,14 @@ impl ComponentLocationToml {
513513
) -> Result<(ContentDigest, PathBuf), anyhow::Error> {
514514
use utils::sha256sum::calculate_sha256_file;
515515

516+
debug!("Fetching {self:?}");
517+
let stopwatch = std::time::Instant::now();
516518
// Happy path: if content_digest is known and file exists in cache, return immediately
517519
if let Some(expected_digest) = expected_digest
518520
&& let wasm_path = content_digest_to_wasm_file(wasm_cache_dir, expected_digest)
519521
&& wasm_path.exists()
520522
{
521-
trace!("Using cached file for known content digest");
523+
debug!("Using cached file for known content digest");
522524
return Ok((expected_digest.clone(), wasm_path));
523525
}
524526

@@ -557,6 +559,8 @@ impl ComponentLocationToml {
557559
"content digest mismatch: expected {expected_digest}, got {actual_digest}"
558560
);
559561
}
562+
let stopwatch = stopwatch.elapsed();
563+
debug!("Fetching done in {stopwatch:?}");
560564
Ok((actual_digest, path))
561565
}
562566
}

src/oci.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub(crate) async fn pull_to_cache_dir(
8888
// Create new file in the metadata directory.
8989
let metadata_file =
9090
digest_to_metadata_file(metadata_dir, &Digest::from_str(&metadata_digest)?);
91+
debug!("Writing WASM digest {layer_content_digest} to metadata file {metadata_file:?}");
9192
tokio::fs::write(&metadata_file, layer_content_digest.to_string()).await?;
9293
(layer, layer_content_digest)
9394
};

0 commit comments

Comments
 (0)