fix remote repo in gitbutler-git tests

This commit is contained in:
Josh Junon 2024-02-08 16:50:10 +01:00 committed by GitButler
parent 0fe1f93e89
commit 8e0ef27de8
3 changed files with 27 additions and 2 deletions

View File

@ -10,6 +10,19 @@ runs:
prefix-key: gitbutler-client prefix-key: gitbutler-client
shared-key: rust shared-key: rust
- name: placeholder for ui assets - name: Placeholder for ui assets
shell: bash shell: bash
run: mkdir gitbutler-ui/build run: mkdir gitbutler-ui/build
- name: Check versions
shell: bash
run: |
rustc --version
cargo --version
cargo fmt --version
cargo clippy --version
git --version
which git-upload-pack
which git-upload-archive
which git-receive-pack
ssh -V

View File

@ -3,6 +3,9 @@ on:
- push - push
- pull_request - pull_request
env:
RUST_BACKTRACE: full
jobs: jobs:
changes: changes:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -140,6 +143,8 @@ jobs:
- [git2] - [git2]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# FIXME(qix-): figure out a way to make these build automatically with tests
- run: cargo build --locked -p gitbutler-git --bin gitbutler-git-askpass --bin gitbutler-git-setsid
- uses: ./.github/actions/check-crate - uses: ./.github/actions/check-crate
with: with:
crate: gitbutler-git crate: gitbutler-git

View File

@ -331,8 +331,15 @@ macro_rules! test_impl {
.join(test_name) .join(test_name)
.to_string_lossy() .to_string_lossy()
.into_owned(); .into_owned();
let repo = $crate::backend::git2::Repository::<$crate::backend::git2::tokio::TokioThreadedResource>::open_or_init_bare(repo_path.clone());
::std::fs::create_dir_all(&repo_path).unwrap();
let repo = $crate::backend::git2::Repository::<
$crate::backend::git2::tokio::TokioThreadedResource
>::open_or_init_bare(repo_path.clone()).await.unwrap();
let server = $crate::private::TestSshServer::new(repo_path); let server = $crate::private::TestSshServer::new(repo_path);
(server, repo) (server, repo)
}.await; }.await;