• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

juarezr / solrcopy / 22875748542

09 Mar 2026 09:31PM UTC coverage: 81.912% (+0.2%) from 81.743%
22875748542

Pull #45

github

web-flow
Merge 305dc337b into 4de9ef34c
Pull Request #45: Bug fixes and improved testing

59 of 71 new or added lines in 8 files covered. (83.1%)

1 existing line in 1 file now uncovered.

1834 of 2239 relevant lines covered (81.91%)

3.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.0
/src/create.rs
1
use super::{args::Execute, connection::SolrClient};
2
use log::{debug, info};
3

4
pub(crate) fn create_main(params: &Execute) -> Result<(), Box<dyn std::error::Error>> {
1✔
5
    debug!("# CREATE {:?}", params);
1✔
6

7
    let mut client = SolrClient::new();
1✔
8
    let information = client.get_solr_info(&params.options.url)?;
1✔
9
    info!("# Solr {}:  {:?}", params.options.url, information);
1✔
10

11
    let core_name = params.options.core.clone();
1✔
12

13
    let std8 =
1✔
14
        r#"{ "create": { "name": "%s", "configSet": "/var/solr/data/configsets/_default" } }"#;
1✔
15
    let std9 = r#"{ "create": { "name": "%s", "configSet": "_default" } }"#;
1✔
16
    let stdx = r#"{ "name": "%s", "configSet": "_default" }"#;
1✔
17
    let cld9 = r#"{ "name": "%s", "config": "_default", "numShards": 1 }"#;
1✔
18

19
    let std = match information.version {
1✔
NEW
20
        8 => std8,
×
NEW
21
        9 => std9,
×
22
        _ => stdx,
1✔
23
    };
24
    let json = if information.standalone { std } else { cld9 };
1✔
25
    let content = json.replace("%s", &core_name);
1✔
26

27
    let api_url = if information.standalone { "api/cores" } else { "api/collections" };
1✔
28
    let url = params.options.get_url_from(api_url);
1✔
29

30
    debug!("# POST {}:\n  {}", url, content);
1✔
31
    println!("# POST {}:\n  {}", url, content);
1✔
32

33
    let res = client.post_as_json(&url, &content)?;
1✔
34

35
    println!("Created the core {} in {}:\n  {}", core_name, url, res);
1✔
36

37
    Ok(())
1✔
38
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc