[M] Rebrand
This commit is contained in:
+15
-15
@@ -2,7 +2,7 @@ use super::*;
|
||||
|
||||
#[test]
|
||||
fn cli_config_opens_wizard() {
|
||||
let cli = Cli::try_parse_from(["git-sync", "config"]).unwrap();
|
||||
let cli = Cli::try_parse_from(["refray", "config"]).unwrap();
|
||||
|
||||
assert!(matches!(cli.command, Command::Config));
|
||||
}
|
||||
@@ -10,11 +10,11 @@ fn cli_config_opens_wizard() {
|
||||
#[test]
|
||||
fn cli_rejects_removed_config_subcommands() {
|
||||
for args in [
|
||||
["git-sync", "config", "wizard"].as_slice(),
|
||||
["git-sync", "config", "init"].as_slice(),
|
||||
["git-sync", "config", "show"].as_slice(),
|
||||
["git-sync", "config", "site", "list"].as_slice(),
|
||||
["git-sync", "config", "mirror", "list"].as_slice(),
|
||||
["refray", "config", "wizard"].as_slice(),
|
||||
["refray", "config", "init"].as_slice(),
|
||||
["refray", "config", "show"].as_slice(),
|
||||
["refray", "config", "site", "list"].as_slice(),
|
||||
["refray", "config", "mirror", "list"].as_slice(),
|
||||
] {
|
||||
assert!(Cli::try_parse_from(args).is_err());
|
||||
}
|
||||
@@ -23,7 +23,7 @@ fn cli_rejects_removed_config_subcommands() {
|
||||
#[test]
|
||||
fn cli_accepts_sync_repo_pattern() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"sync",
|
||||
"--repo-pattern",
|
||||
"^(foo|bar)-",
|
||||
@@ -40,7 +40,7 @@ fn cli_accepts_sync_repo_pattern() {
|
||||
|
||||
#[test]
|
||||
fn cli_accepts_sync_retry_failed() {
|
||||
let cli = Cli::try_parse_from(["git-sync", "sync", "--retry-failed"]).unwrap();
|
||||
let cli = Cli::try_parse_from(["refray", "sync", "--retry-failed"]).unwrap();
|
||||
|
||||
let Command::Sync(args) = cli.command else {
|
||||
panic!("parsed unexpected command");
|
||||
@@ -50,7 +50,7 @@ fn cli_accepts_sync_retry_failed() {
|
||||
|
||||
#[test]
|
||||
fn cli_accepts_sync_jobs() {
|
||||
let cli = Cli::try_parse_from(["git-sync", "sync", "--jobs", "8"]).unwrap();
|
||||
let cli = Cli::try_parse_from(["refray", "sync", "--jobs", "8"]).unwrap();
|
||||
|
||||
let Command::Sync(args) = cli.command else {
|
||||
panic!("parsed unexpected command");
|
||||
@@ -61,7 +61,7 @@ fn cli_accepts_sync_jobs() {
|
||||
#[test]
|
||||
fn cli_accepts_webhook_serve() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"serve",
|
||||
"--listen",
|
||||
"127.0.0.1:9000",
|
||||
@@ -86,7 +86,7 @@ fn cli_accepts_webhook_serve() {
|
||||
#[test]
|
||||
fn cli_accepts_webhook_install() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"webhook",
|
||||
"install",
|
||||
"repo-one",
|
||||
@@ -118,7 +118,7 @@ fn cli_accepts_webhook_install() {
|
||||
#[test]
|
||||
fn cli_accepts_webhook_install_repo_pattern() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"webhook",
|
||||
"install",
|
||||
"--url",
|
||||
@@ -140,7 +140,7 @@ fn cli_accepts_webhook_install_repo_pattern() {
|
||||
#[test]
|
||||
fn cli_accepts_webhook_uninstall() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"webhook",
|
||||
"uninstall",
|
||||
"repo-one",
|
||||
@@ -170,7 +170,7 @@ fn cli_accepts_webhook_uninstall() {
|
||||
#[test]
|
||||
fn cli_accepts_webhook_update() {
|
||||
let cli = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"webhook",
|
||||
"update",
|
||||
"--url",
|
||||
@@ -193,7 +193,7 @@ fn cli_accepts_webhook_update() {
|
||||
#[test]
|
||||
fn cli_rejects_scoped_webhook_update() {
|
||||
let result = Cli::try_parse_from([
|
||||
"git-sync",
|
||||
"refray",
|
||||
"webhook",
|
||||
"update",
|
||||
"repo-one",
|
||||
|
||||
@@ -123,7 +123,7 @@ fn wizard_can_enable_webhooks() {
|
||||
);
|
||||
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
assert!(output.contains("git-sync serve --listen 127.0.0.1:8787"));
|
||||
assert!(output.contains("refray serve --listen 127.0.0.1:8787"));
|
||||
assert!(output.contains("cloudflared tunnel --url http://127.0.0.1:8787"));
|
||||
assert!(output.contains("POST / and POST /webhook"));
|
||||
assert!(output.contains("temporary listener on 127.0.0.1:8787"));
|
||||
@@ -539,7 +539,7 @@ fn token_creation_urls_are_provider_specific() {
|
||||
);
|
||||
assert_eq!(
|
||||
token_creation_url(&ProviderKind::Gitlab, "https://gitlab.example.test"),
|
||||
"https://gitlab.example.test/-/user_settings/personal_access_tokens?name=git-sync&scopes=api,write_repository"
|
||||
"https://gitlab.example.test/-/user_settings/personal_access_tokens?name=refray&scopes=api,write_repository"
|
||||
);
|
||||
assert_eq!(
|
||||
token_creation_url(&ProviderKind::Gitea, "gitea.example.test"),
|
||||
@@ -561,6 +561,6 @@ fn demo_webhook_server_answers_reachability_checks() {
|
||||
response
|
||||
.text()
|
||||
.unwrap()
|
||||
.contains("git-sync webhook setup listener")
|
||||
.contains("refray webhook setup listener")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ where
|
||||
R: BufRead,
|
||||
W: Write,
|
||||
{
|
||||
writeln!(writer, "git-sync configuration wizard")?;
|
||||
writeln!(writer, "refray configuration wizard")?;
|
||||
if config.mirrors.is_empty() {
|
||||
add_sync_group(reader, writer, &mut config)?;
|
||||
write_sync_groups(&config, writer)?;
|
||||
@@ -182,7 +182,7 @@ where
|
||||
)?;
|
||||
writeln!(
|
||||
writer,
|
||||
"Start the receiver with: git-sync serve --listen 127.0.0.1:8787"
|
||||
"Start the receiver with: refray serve --listen 127.0.0.1:8787"
|
||||
)?;
|
||||
writeln!(writer, "The receiver accepts: POST / and POST /webhook")?;
|
||||
writeln!(
|
||||
@@ -195,7 +195,7 @@ where
|
||||
)?;
|
||||
writeln!(
|
||||
writer,
|
||||
"During the real wizard, git-sync starts a temporary listener on 127.0.0.1:8787 so you can test the tunnel now."
|
||||
"During the real wizard, refray starts a temporary listener on 127.0.0.1:8787 so you can test the tunnel now."
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -431,7 +431,7 @@ where
|
||||
.map(conflict_resolution_value)
|
||||
.unwrap_or("auto-rebase + pull-request");
|
||||
loop {
|
||||
writeln!(writer, "How should git-sync resolve branch conflicts?")?;
|
||||
writeln!(writer, "How should refray resolve branch conflicts?")?;
|
||||
writeln!(writer, " 1. fail")?;
|
||||
writeln!(writer, " 2. auto-rebase and fail on file conflict")?;
|
||||
writeln!(writer, " 3. pull-request")?;
|
||||
|
||||
@@ -277,7 +277,7 @@ fn open_pull_request_posts_github_pull_when_missing() {
|
||||
"request was {request}"
|
||||
);
|
||||
assert!(request.contains("Resolve conflict"));
|
||||
assert!(request.contains("git-sync/conflicts/main/from-b-abc123"));
|
||||
assert!(request.contains("refray/conflicts/main/from-b-abc123"));
|
||||
assert!(request.contains("main"));
|
||||
}
|
||||
_ => unreachable!(),
|
||||
@@ -305,7 +305,7 @@ fn open_pull_request_posts_github_pull_when_missing() {
|
||||
&PullRequestRequest {
|
||||
title: "Resolve conflict".to_string(),
|
||||
body: "Body".to_string(),
|
||||
head_branch: "git-sync/conflicts/main/from-b-abc123".to_string(),
|
||||
head_branch: "refray/conflicts/main/from-b-abc123".to_string(),
|
||||
base_branch: "main".to_string(),
|
||||
},
|
||||
)
|
||||
@@ -321,7 +321,7 @@ fn close_pull_requests_by_head_prefix_closes_matching_github_pulls() {
|
||||
vec![
|
||||
(
|
||||
"200 OK",
|
||||
r#"[{"number":7,"head":{"ref":"git-sync/conflicts/main/from-b-abc123"}},{"number":8,"head":{"ref":"feature"}}]"#,
|
||||
r#"[{"number":7,"head":{"ref":"refray/conflicts/main/from-b-abc123"}},{"number":8,"head":{"ref":"feature"}}]"#,
|
||||
),
|
||||
("200 OK", r#"{"number":7}"#),
|
||||
],
|
||||
@@ -361,7 +361,7 @@ fn close_pull_requests_by_head_prefix_closes_matching_github_pulls() {
|
||||
description: None,
|
||||
},
|
||||
"main",
|
||||
"git-sync/conflicts/main/",
|
||||
"refray/conflicts/main/",
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ fn conflict_branch_prefixes_are_reversible_not_slug_collisions() {
|
||||
assert_ne!(slash_branch, dash_branch);
|
||||
assert!(slash_branch.starts_with(CONFLICT_BRANCH_ROOT));
|
||||
assert!(dash_branch.starts_with(CONFLICT_BRANCH_ROOT));
|
||||
assert!(conflict_pr_branch("main", "gitea", "abc123").starts_with(CONFLICT_BRANCH_ROOT));
|
||||
assert_eq!(
|
||||
conflict_pr_base_branch(&format!("{slash_branch}from-gitea-abc123")),
|
||||
Some("release/foo".to_string())
|
||||
|
||||
Reference in New Issue
Block a user