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

juarezr / solrcopy / 22975356339

11 Mar 2026 09:28PM UTC coverage: 81.975% (+0.2%) from 81.743%
22975356339

Pull #45

github

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

276 of 310 new or added lines in 13 files covered. (89.03%)

8 existing lines in 5 files now uncovered.

1901 of 2319 relevant lines covered (81.97%)

3.61 hits per line

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

91.3
/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 sinf = client.get_solr_info(&params.options.url)?;
1✔
9
    info!(
1✔
10
        "# URL: '{}', version:  {}, standalone: {}",
11
        params.options.url, sinf.version, sinf.standalone
12
    );
13

14
    let core_name = params.options.core.clone();
1✔
15

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

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

30
    let api_url = if sinf.standalone { "api/cores" } else { "api/collections" };
1✔
31
    let url = params.options.get_url_from(api_url);
1✔
32

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

35
    info!("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