Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ jobs:
- run: cargo test --locked -p visualci-app
env:
VISUALCI_EMAIL_SNAPSHOTS: ${{ github.workspace }}/tmp/email-snapshots
# The blob store's own account of a failed run (a bucket that went missing, a restart): RustFS logs to stdout.
- if: failure()
run: docker logs s3 2>&1 | tail -n 300
- uses: actions/upload-artifact@v4
with:
name: email-snapshots
Expand Down
2 changes: 1 addition & 1 deletion app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ serde_json = "1"
# Names the field at fault when a visualci.yml doesn't parse (build_settings::parse_config)
serde_path_to_error = "0.1"
sha2 = "0.10"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal", "time"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] }
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
rusty-s3 = "0.12"
Expand Down
19 changes: 14 additions & 5 deletions app/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,21 @@ pub mod fixtures {
/// # Errors
/// When the store (`VISUALCI_APP_TEST_S3_ENDPOINT`, else RustFS on port 59000 as in CI) isn't reachable.
pub async fn blob_store() -> laravel::Result<crate::storage::BlobStore> {
// Made once per test process, not by every test: the tests in one binary start together, and a bucket many of
// them created at once on a fresh RustFS went missing under their first uploads (NoSuchBucket; #217, run
// 47389263799).
static BUCKET: tokio::sync::OnceCell<()> = tokio::sync::OnceCell::const_new();
let store = crate::storage::BlobStore::current().await?;
store.ensure_bucket().await.map_err(|e| {
laravel::Error::msg(format!(
"the blob store isn't reachable (VISUALCI_APP_TEST_S3_ENDPOINT, else RustFS on 127.0.0.1:59000 as in CI): {e}"
))
})?;
BUCKET
.get_or_try_init(|| async {
store.ensure_bucket().await.map_err(|e| {
laravel::Error::msg(format!(
"the blob store isn't reachable (VISUALCI_APP_TEST_S3_ENDPOINT, else RustFS on 127.0.0.1:59000 as \
in CI): {e}"
))
})
})
.await?;
Ok(store)
}

Expand Down
Loading