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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: cargo fmt --check
- run: cargo clippy --locked --all-targets -- -D warnings
- run: cargo build --release --locked --target x86_64-pc-windows-msvc
- run: python scripts/archive.py x86_64-pc-windows-msvc
- shell: pwsh
Expand Down
11 changes: 9 additions & 2 deletions src/agent/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,16 +522,19 @@ fn a_separate_writer_lock_refuses_without_replacement_and_retry_converges() {
let lock_path = path.parent().unwrap().join(".proofline-agent-install.lock");
let entered = Arc::new(Barrier::new(2));
let release = Arc::new(Barrier::new(2));
#[cfg(unix)]
let thread_lock_path = lock_path.clone();
#[cfg(not(unix))]
let thread_lock_path = lock_path;
let worker = {
let lock_path = lock_path.clone();
let entered = Arc::clone(&entered);
let release = Arc::clone(&release);
std::thread::spawn(move || {
let lease = OpenOptions::new()
.read(true)
.write(true)
.create_new(true)
.open(lock_path)
.open(&thread_lock_path)
.unwrap();
lease.try_lock().unwrap();
entered.wait();
Expand Down Expand Up @@ -740,6 +743,10 @@ fn invalid_duplicate_oversized_and_readonly_documents_stay_private_and_intact()
#[cfg(unix)]
fs::set_permissions(&path, fs::Permissions::from_mode(0o600)).unwrap();
#[cfg(not(unix))]
#[expect(
clippy::permissions_set_readonly_false,
reason = "Windows has no Unix mode bits; clearing readonly is required before removing the file"
)]
{
let mut permissions = fs::metadata(&path).unwrap().permissions();
permissions.set_readonly(false);
Expand Down
7 changes: 6 additions & 1 deletion tests/agent_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ fn unattended_registration_preserves_settings_and_uses_the_installed_binary() {
assert_eq!(config, serde_json::from_str::<Value>(&original).unwrap());
server
};
assert_eq!(server["command"], executable.to_str().unwrap());
assert_eq!(
Path::new(server["command"].as_str().unwrap())
.canonicalize()
.unwrap(),
executable
);
assert_eq!(
server["args"],
json!(["--base-url", "https://proofline.sh", "mcp"])
Expand Down
13 changes: 11 additions & 2 deletions tests/local_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,16 @@ async fn added_context_deleted_and_quoted_content_refuses_before_http() {
let base = format!("first\n{private}\nthird\nfourth\n");
let context = format!("first\n{private}\nthird\nchanged\n");
let added = format!("first\n{github}\n");
let quoted = "src/clé\t\"quoted\".txt";
#[cfg(unix)]
let (quoted, quoted_diagnostic) = (
"src/clé\t\"quoted\".txt",
"\"src/clé\\t\\\"quoted\\\".txt\":2 (new line)",
);
#[cfg(not(unix))]
let (quoted, quoted_diagnostic) = (
"src/clé 'quoted'.txt",
"\"src/clé 'quoted'.txt\":2 (new line)",
);
for (path, before, after, diagnostic, secret) in [
(
"new.txt",
Expand All @@ -588,7 +597,7 @@ async fn added_context_deleted_and_quoted_content_refuses_before_http() {
quoted,
None,
added.as_str(),
"\"src/clé\\t\\\"quoted\\\".txt\":2 (new line)",
quoted_diagnostic,
github.as_str(),
),
] {
Expand Down
11 changes: 7 additions & 4 deletions tests/mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ struct Finished {

impl Bridge {
fn start(origin: &str, organization: &str) -> Self {
let mut child = Command::new(env!("CARGO_BIN_EXE_proofline"))
let mut command = Command::new(env!("CARGO_BIN_EXE_proofline"));
command
.env_clear()
.env("PROOFLINE_TOKEN", TOKEN)
.env("PROOFLINE_ORGANIZATION_ID", organization)
Expand All @@ -320,9 +321,11 @@ impl Bridge {
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.kill_on_drop(true)
.spawn()
.unwrap();
.kill_on_drop(true);
if let Some(system_root) = std::env::var_os("SYSTEMROOT") {
command.env("SYSTEMROOT", system_root);
}
let mut child = command.spawn().unwrap();
Self {
input: child.stdin.take(),
output: child.stdout.take().map(BufReader::new),
Expand Down