Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions apps/local-qa-runtime/browser-adapter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ pub enum BrowserAdapterError {
}

pub async fn run_fixed_browser_smoke() -> Result<FixedBrowserSmokeResult, BrowserAdapterError> {
#[cfg(any(
target_os = "linux",
all(target_os = "macos", target_arch = "aarch64")
))]
#[cfg(any(target_os = "linux", all(target_os = "macos", target_arch = "aarch64")))]
{
let (sender, receiver) = futures_channel::oneshot::channel();
std::thread::Builder::new()
Expand All @@ -55,19 +52,13 @@ pub async fn run_fixed_browser_smoke() -> Result<FixedBrowserSmokeResult, Browse
})?
}

#[cfg(not(any(
target_os = "linux",
all(target_os = "macos", target_arch = "aarch64")
)))]
#[cfg(not(any(target_os = "linux", all(target_os = "macos", target_arch = "aarch64"))))]
{
Err(BrowserAdapterError::UnsupportedPlatform)
}
}

#[cfg(any(
target_os = "linux",
all(target_os = "macos", target_arch = "aarch64")
))]
#[cfg(any(target_os = "linux", all(target_os = "macos", target_arch = "aarch64")))]
mod unix {
use super::{BrowserAdapterError, FixedBrowserSmokeResult, FixedPngScreenshot};
use headless_chrome::{protocol::cdp::Page, Browser, Tab};
Expand Down
8 changes: 5 additions & 3 deletions apps/local-qa-runtime/evidence-stager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicU64, Ordering};

use fkst_qa_contracts::{
contract_content_digest, validate_local_evidence_object,
validate_local_evidence_object_ref, ValidatedValue,
contract_content_digest, validate_local_evidence_object, validate_local_evidence_object_ref,
ValidatedValue,
};
use serde_json::json;
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -149,7 +149,9 @@ impl EvidenceStager {
.write_all(request.bytes)
.map_err(|_| StagerError::Storage)?;
temporary_file.flush().map_err(|_| StagerError::Storage)?;
temporary_file.sync_all().map_err(|_| StagerError::Storage)?;
temporary_file
.sync_all()
.map_err(|_| StagerError::Storage)?;
drop(temporary_file);

fs::rename(&temporary_path, &final_path).map_err(|_| StagerError::Storage)?;
Expand Down
14 changes: 7 additions & 7 deletions apps/local-qa-runtime/evidence-stager/tests/runner_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use std::fs;
use std::path::{Path, PathBuf};

use fkst_local_qa_evidence_stager::{
EvidenceMediaType, EvidenceRole, EvidenceStager, StageRequest, StagerError,
MAX_EVIDENCE_BYTES,
EvidenceMediaType, EvidenceRole, EvidenceStager, StageRequest, StagerError, MAX_EVIDENCE_BYTES,
};
use fkst_qa_contracts::{
canonical_bytes, contract_content_digest, validate_local_evidence_object,
Expand Down Expand Up @@ -57,7 +56,10 @@ fn stages_and_verifies_one_runner_log() {
canonical_bytes(staged.object()).unwrap(),
CANONICAL_OBJECT.as_bytes()
);
assert_eq!(contract_content_digest(staged.object()).unwrap(), CONTRACT_DIGEST);
assert_eq!(
contract_content_digest(staged.object()).unwrap(),
CONTRACT_DIGEST
);

let expected_ref = json!({
"kind": "local-evidence-object",
Expand All @@ -66,10 +68,8 @@ fn stages_and_verifies_one_runner_log() {
"content_digest": CONTRACT_DIGEST,
});
assert_eq!(staged.object_ref().value(), &expected_ref);
validate_local_evidence_object_ref(
&serde_json::to_vec(staged.object_ref().value()).unwrap(),
)
.unwrap();
validate_local_evidence_object_ref(&serde_json::to_vec(staged.object_ref().value()).unwrap())
.unwrap();

let files = regular_files(temporary_parent.path());
assert_eq!(files.len(), 1);
Expand Down
Loading