Skip to content

Commit

Permalink
build: delete git-branchless-testing crate
Browse files Browse the repository at this point in the history
The `git-branchless-lib` crate has a dev-dependency on `git-branchless-testing`, and `git-branchless-testing` has a dependency on `git-branchless-lib`, inducing a circular dependency that means they can't be published to crates.io. This commit collapses them into the same crate again to resolve this circular dependency.
  • Loading branch information
arxanas committed Aug 27, 2023
1 parent 9ebe918 commit ee2a7df
Show file tree
Hide file tree
Showing 51 changed files with 54 additions and 111 deletions.
31 changes: 2 additions & 29 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ members = [
"git-branchless-smartlog",
"git-branchless-submit",
"git-branchless-test",
"git-branchless-testing",
"git-branchless-undo",
"git-branchless",
"git-record",
Expand Down Expand Up @@ -105,6 +104,5 @@ vt100 = "0.15.2"
assert_cmd = "2.0.7"
cc = "1.0.83"
criterion = { version = "0.5.1", features = ["html_reports"] }
git-branchless-testing = { version = "0.8.0", path = "git-branchless-testing" }
insta = "1.31.0"
maplit = "1.0.2"
1 change: 0 additions & 1 deletion git-branchless-hook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ regex = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-hook/tests/test_hook.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use git_branchless_testing::{make_git, GitRunOptions};
use lib::testing::{make_git, GitRunOptions};

#[test]
fn test_is_rebase_underway() -> eyre::Result<()> {
Expand Down
3 changes: 2 additions & 1 deletion git-branchless-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ indicatif = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
once_cell = { workspace = true }
portable-pty = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
rusqlite = { workspace = true }
Expand All @@ -73,9 +74,9 @@ tracing = { workspace = true }
tracing-chrome = { workspace = true }
tracing-error = { workspace = true }
tracing-subscriber = { workspace = true }
vt100 = { workspace = true }

[dev-dependencies]
cc = { workspace = true }
criterion = { workspace = true }
git-branchless-testing = { workspace = true }
insta = { workspace = true }
1 change: 1 addition & 0 deletions git-branchless-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@

pub mod core;
pub mod git;
pub mod testing;
pub mod util;
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

use crate::core::config::env_vars::{
get_git_exec_path, get_path_to_git, should_use_separate_command_binary, TEST_GIT,
TEST_SEPARATE_COMMAND_BINARIES,
};
use crate::git::{GitRunInfo, GitVersion, NonZeroOid, Repo};
use crate::util::get_sh;
use color_eyre::Help;
use eyre::Context;
use itertools::Itertools;
use lazy_static::lazy_static;
use lib::core::config::env_vars::{
get_git_exec_path, get_path_to_git, should_use_separate_command_binary, TEST_GIT,
TEST_SEPARATE_COMMAND_BINARIES,
};
use lib::git::{GitRunInfo, GitVersion, NonZeroOid, Repo};
use lib::util::get_sh;
use once_cell::sync::OnceCell;
use regex::{Captures, Regex};
use tempfile::TempDir;
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_eventlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use branchless::core::eventlog::{
testing::new_event_replayer, Event, EventLogDb, EventTransactionId,
};
use branchless::git::{MaybeZeroOid, NonZeroOid, ReferenceName};
use git_branchless_testing::make_git;
use branchless::testing::make_git;

#[test]
fn test_drop_non_meaningful_events() -> eyre::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_git_run.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use branchless::git::{GitRunInfo, GitRunOpts};
use git_branchless_testing::make_git;
use branchless::testing::make_git;

#[test]
fn test_hook_working_dir() -> eyre::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_git_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
};

use branchless::git::{dehydrate_tree, get_changed_paths_between_trees, hydrate_tree, FileMode};
use git_branchless_testing::make_git;
use branchless::testing::make_git;

#[test]
fn test_hydrate_tree() -> eyre::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use branchless::git::{
AmendFastOptions, BranchType, CherryPickFastOptions, FileMode, FileStatus, GitVersion,
StatusEntry,
};
use git_branchless_testing::make_git;
use branchless::testing::make_git;

#[test]
fn test_parse_git_version_output() {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_rewrite_evolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use branchless::core::eventlog::{EventLogDb, EventReplayer};
use branchless::core::formatting::Glyphs;
use branchless::core::rewrite::find_rewrite_target;
use branchless::git::MaybeZeroOid;
use branchless::testing::{make_git, Git, GitRunOptions};
use branchless::{core::effects::Effects, git::NonZeroOid};
use git_branchless_testing::{make_git, Git, GitRunOptions};

fn find_rewrite_target_helper(
effects: &Effects,
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_rewrite_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use branchless::core::rewrite::{
execute_rebase_plan, BuildRebasePlanOptions, ExecuteRebasePlanOptions, ExecuteRebasePlanResult,
RebasePlan, RebasePlanBuilder, RepoResource,
};
use git_branchless_testing::{make_git, Git};
use branchless::testing::{make_git, Git};

#[test]
fn test_cache_shared_between_builders() -> eyre::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use branchless::core::effects::Effects;
use branchless::core::eventlog::EventLogDb;
use branchless::core::formatting::Glyphs;
use branchless::git::WorkingCopyChangesType;
use git_branchless_testing::{make_git, GitRunOptions};
use branchless::testing::{make_git, GitRunOptions};

#[test]
fn test_has_conflicts() -> eyre::Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion git-branchless-lib/tests/test_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;
use branchless::core::effects::Effects;
use branchless::core::formatting::Glyphs;
use branchless::git::{FileMode, FileStatus, StatusEntry, WorkingCopyChangesType};
use git_branchless_testing::make_git;
use branchless::testing::make_git;

#[test]
fn test_parse_status_line() {
Expand Down
1 change: 0 additions & 1 deletion git-branchless-query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ lib = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-query/tests/test_query.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use git_branchless_testing::{make_git, GitRunOptions};
use lib::testing::{make_git, GitRunOptions};

#[test]
fn test_query() -> eyre::Result<()> {
Expand Down
1 change: 0 additions & 1 deletion git-branchless-record/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ scm-record = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
4 changes: 2 additions & 2 deletions git-branchless-record/tests/test_record.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use git_branchless_testing::pty::{run_in_pty, PtyAction, DOWN_ARROW};
use git_branchless_testing::{make_git, GitInitOptions, GitRunOptions};
use lib::testing::pty::{run_in_pty, PtyAction, DOWN_ARROW};
use lib::testing::{make_git, GitInitOptions, GitRunOptions};

#[test]
fn test_record_unstaged_changes() -> eyre::Result<()> {
Expand Down
1 change: 0 additions & 1 deletion git-branchless-revset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ tracing = { workspace = true }
lalrpop = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-revset/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ pub(super) fn eval_number_rhs(
mod tests {
use std::borrow::Cow;

use git_branchless_testing::{make_git, GitRunOptions};
use lib::core::effects::Effects;
use lib::core::eventlog::{EventLogDb, EventReplayer};
use lib::core::formatting::Glyphs;
use lib::core::repo_ext::RepoExt;
use lib::git::Commit;
use lib::testing::{make_git, GitRunOptions};

use super::*;
use crate::Expr;
Expand Down
1 change: 0 additions & 1 deletion git-branchless-reword/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ tempfile = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-reword/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ fn render_status_report(
#[cfg(test)]
mod tests {
use super::*;
use git_branchless_testing::make_git;
use lib::testing::make_git;
use std::collections::BTreeMap;

#[test]
Expand Down
1 change: 0 additions & 1 deletion git-branchless-smartlog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ lib = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-smartlog/tests/test_smartlog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use git_branchless_testing::{extract_hint_command, make_git, GitRunOptions};
use lib::testing::{extract_hint_command, make_git, GitRunOptions};

#[test]
fn test_init_smartlog() -> eyre::Result<()> {
Expand Down
1 change: 0 additions & 1 deletion git-branchless-submit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ tracing = { workspace = true }

[dev-dependencies]
clap = { workspace = true }
git-branchless-testing = { workspace = true }
insta = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-submit/tests/test_phabricator_forge.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use git_branchless_testing::{make_git, GitRunOptions, GitWrapper};
use lib::testing::{make_git, GitRunOptions, GitWrapper};

fn mock_env(git: &GitWrapper) -> HashMap<String, String> {
git.get_base_env(0)
Expand Down
4 changes: 2 additions & 2 deletions git-branchless-submit/tests/test_submit.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use git_branchless_testing::{
use lib::git::GitVersion;
use lib::testing::{
make_git_with_remote_repo, remove_nondeterministic_lines, GitInitOptions, GitRunOptions,
GitWrapperWithRemoteRepo,
};
use lib::git::GitVersion;

/// Minimum version due to changes in the output of `git push`.
const MIN_VERSION: GitVersion = GitVersion(2, 36, 0);
Expand Down
1 change: 0 additions & 1 deletion git-branchless-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ tracing = { workspace = true }

[dev-dependencies]
assert_cmd = { workspace = true }
git-branchless-testing = { workspace = true }
insta = { workspace = true }
maplit = { workspace = true }
2 changes: 1 addition & 1 deletion git-branchless-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,7 @@ pub fn subcommand_clean(

#[cfg(test)]
mod tests {
use git_branchless_testing::make_git;
use lib::testing::make_git;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion git-branchless-test/tests/test_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use git_branchless_testing::{make_git, GitRunOptions, GitWrapper};
use lib::testing::{make_git, GitRunOptions, GitWrapper};
use maplit::hashmap;

fn write_test_script(git: &GitWrapper) -> eyre::Result<()> {
Expand Down
Loading

0 comments on commit ee2a7df

Please sign in to comment.