Skip to content

Commit

Permalink
Omega meld of so much in-progress work
Browse files Browse the repository at this point in the history
rebase this

test(image_cache): Add tests for image cache headers

rebase this

f

Migrate over to `http-cache-semantics`

f

refactor(tests): Drop wiremock (#320)

* docs: Describe what we use deps for

* refactor(tests): Switch `wiremock` for a custom impl

refactor(tests): simplify the file server (#321)

Refactor local image caching

Hashing out more of the impl

needs _soooo_ much refactoring

Dirty rebase artifacts. Fix later

rebase me away

slowly getting the final pieces together

time to update with `main`

Nail down most of the routing

Dont pre-render SVGs before storage

Get more of the custom test env setup

Get the sanity test working

refactor(cache): Switch db from redb to sqlite

Use our shiny new test utils

refactor: Delete dead test code

rebase into commit that added it

rename images.data -> images.image

remove redb dep

lalalalala

f

get local image fetching working

Get more tests sorted out

Shrank test data image rebase original file out of git history

Test suite is getting better

getting closer

Add etag flow to test server

test: Add support for dynamic image test servers

rebase this: lru test mostly working

rebase this

some cleanup

more image cache tests
  • Loading branch information
CosmicHorrorDev committed Nov 4, 2024
1 parent 0407bdc commit 8b2ebb9
Show file tree
Hide file tree
Showing 26 changed files with 2,647 additions and 126 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
on: [push]

name: codecov

on:
pull_request:
push:
branches:
- main

jobs:
coverage:
runs-on: ubuntu-latest
Expand Down
91 changes: 91 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ anstream = "0.6.14"
anstyle = "1.0.7"
# Easier error handling
anyhow = "1.0.86"
bincode = "1.3.3"
# System preferred color scheme detection
dark-light = "1.1.1"
# System specific directories
Expand All @@ -49,6 +50,8 @@ glyphon = "0.3"
html-escape = "0.2.13"
# Parsing the HTML document that the markdown+html was converted into
html5ever = "0.27.0"
http = "1.1.0"
http-cache-semantics = "2.1.0"
# Provides some extra helpers that we use for our custom panic hook
human-panic = "2.0.0"
# Generic image decoding
Expand All @@ -72,7 +75,9 @@ pollster = "0.3.0"
raw-window-handle = "0.5.2"
# SVG rendering
resvg = "0.39.0"
# Parses the optional YAML frontmatter (replace with just a yaml parser)
# Sqlite DB for our image cache
rusqlite = { version = "0.31.0", features = ["bundled"] }
# Parses the optional YAML frontmatter (TODO: replace with just a yaml parser)
serde_yaml = "0.9.34"
# Easy `Debug` formatting changes used to keep snapshot tests more succinct
smart-debug = "0.0.3"
Expand All @@ -90,7 +95,8 @@ two-face = "0.4.0"
# More text hashing...
twox-hash = "1.6.3"
# HTTP client for requesting images from urls
ureq = "2.9.7"
ureq = { version = "2.9.7", features = ["http-crate"] }
url = "2.5.0"
# Cross platform GPU magic sauce
wgpu = "0.16"

Expand Down Expand Up @@ -197,3 +203,9 @@ ttf-parser.opt-level = 2
rustybuzz.opt-level = 2
cosmic-text.opt-level = 2
png.opt-level = 2
gif.opt-level = 2
image.opt-level = 2
lz4_flex.opt-level = 2
tiny-skia.opt-level = 2
fontdb.opt-level = 2
image-webp.opt-level = 2
Binary file modified assets/test_data/cargo_public_api.webp
Binary file not shown.
8 changes: 3 additions & 5 deletions src/file_watcher/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::path::{Path, PathBuf};
use std::sync::mpsc;
use std::time::Duration;

use crate::test_utils::temp;

use super::{Callback, Watcher};

use tempfile::TempDir;
Expand Down Expand Up @@ -62,11 +64,7 @@ impl Delays {

fn init_test_env() -> (TestEnv, TempDir) {
// Create our dummy test env
let temp_dir = tempfile::Builder::new()
.prefix("inlyne-tests-")
.tempdir()
.unwrap();
let base = temp_dir.path();
let (temp_dir, base) = temp::dir();
let main_file = base.join("main.md");
let rel_file = base.join("rel.md");
fs::write(&main_file, "# Main\n\n[rel](./rel.md)").unwrap();
Expand Down
7 changes: 2 additions & 5 deletions src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ mod tests {
use std::fs;

use super::*;
use crate::test_utils::temp;

#[test]
fn sanity() {
let temp_dir = tempfile::Builder::new()
.prefix("inlyne-tests-")
.tempdir()
.unwrap();
let temp_path = temp_dir.path().canonicalize().unwrap();
let (_temp_dir, temp_path) = temp::dir();

let root = temp_path.join("a");
let fork1 = temp_path.join("b");
Expand Down
Loading

0 comments on commit 8b2ebb9

Please # to comment.