Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5636603
fix: skip writing empty json when --iterate-by slices match no docs
juarezr Mar 7, 2026
ef0056d
fix: add support to testing with docker image solr:10-slim
juarezr Mar 7, 2026
50e0f10
feat: add support to selecting the solr docker image tag for tests
juarezr Mar 7, 2026
4ed6416
refactor: improve cargo make task names
juarezr Mar 7, 2026
9bb6d04
chore: update crate dependencies, especially zip v8.x
juarezr Mar 7, 2026
5ae8e69
chore: map dir docker/configuration inside docker test container
juarezr Mar 9, 2026
8a673df
refactor: improve healthcheck of the test contatiner
juarezr Mar 9, 2026
5a6d0fa
refactor: add MODE/SOLR_RUN_MODE to choose the Solr run mode in the t…
juarezr Mar 9, 2026
c483959
feat: add command: solrcopy info
juarezr Mar 9, 2026
acade33
fix: make solrcopy create work with Solr v10
juarezr Mar 9, 2026
de5a657
fix: dont wait in test execution
juarezr Mar 9, 2026
4a3645b
chore: fix lint from clone usage
juarezr Mar 9, 2026
c0294cb
chore(vscode): debug test cases withh feature testsolr
juarezr Mar 9, 2026
b0de3a8
chore(vscode): add lauch config for tests
juarezr Mar 9, 2026
305dc33
ci: fix renamed command in the test container
juarezr Mar 9, 2026
4f54c72
fix: enable logging for commands create and info
juarezr Mar 10, 2026
fb4fb2e
refactor: make connection::get_as_json send Content-Type: application…
juarezr Mar 10, 2026
806fc36
refactor: rework logging of messages
juarezr Mar 10, 2026
13f6588
refactor: simplify backup/restore code by encapsuling the algorith in…
juarezr Mar 10, 2026
ee89d05
fix: renable some min/max validation for command line args
juarezr Mar 10, 2026
3b3dde6
chore: update rust-version to 1.88 to fix CI MRSV check
juarezr Mar 11, 2026
64e2276
fix: mark --skip as imcompatible with --iterate-by
juarezr Mar 11, 2026
f86f2e4
fix: ignore log messages from ureq crate
juarezr Mar 11, 2026
88572e0
refactor: reclassify some debug/trace logs
juarezr Mar 11, 2026
7b7dcb7
refactor: rework progress bar updates
juarezr Mar 11, 2026
5ce1273
refactor: fix some clippy lints
juarezr Mar 11, 2026
226a575
fix: make the flag --iterate-by work for solrcopy backup
juarezr Mar 11, 2026
32c30b7
chore: upgrade release version to 0.9.0
juarezr Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
run: |
sleep 10
echo '::group::Executing a script inside the docker container';
docker compose -f docker/docker-compose.yml exec solr solr-ingest-all 2>&1
docker compose -f docker/docker-compose.yml exec solr solr-ingest-examples 2>&1
echo '::endgroup::';

- name: Run cargo test
Expand Down
61 changes: 61 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,48 @@
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Solr-tests",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=solrcopy",
"--package=solrcopy",
"--features",
"testsolr",
],
"filter": {
"name": "solrcopy",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "testcase",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=solrcopy",
"--package=solrcopy",
"--features",
"testsolr",
],
"filter": {
"name": "${input:testcase}",
"kind": "test"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
Expand Down Expand Up @@ -201,6 +243,11 @@
"type": "promptString",
"description": "Enter the arguments to be passed to program running:"
},
{
"id": "testcase",
"type": "promptString",
"description": "Enter the name of the test case/function to run/debug:"
},
{
"id": "folder",
"type": "pickString",
Expand Down Expand Up @@ -228,6 +275,20 @@
"description": "Enter the SOLR URL:",
"default": "http://localhost:8983/solr"
},
{
"id": "core",
"type": "pickString",
"description": "What Solr core do you want to use?",
"options": [
"demo",
"films",
"films2",
"target",
"testing",
"testing2",
],
"default": "demo"
},
{
"id": "query",
"type": "promptString",
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"testing.coverageToolbarEnabled": true,
// Show the Test Explorer view.
"rust-analyzer.testExplorer": true,
"rust-analyzer.cargo.features": [ "testsolr" ],
"rust-analyzer.check.features": [ "testsolr" ],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
Expand Down
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "solrcopy"
version = "0.8.1"
version = "0.9.0"
edition = "2024"
rust-version = "1.85.1"
rust-version = "1.88"

authors = ["Juarez Rudsatz <juarezr@gmail.com>"]
description = "Command line tool useful for migration, transformations, backup, and restore of documents stored inside cores of Apache Solr"
Expand Down Expand Up @@ -31,11 +31,11 @@ exclude = [
clap = { version = "4.5.*", features = ["derive", "env", "color"] }
clap_complete = "4.5.*"
clap_mangen = "0.2.*"
regex = "1.11.*"
regex = "1.12.*"
url = "2.5.*"
lazy_static = "1.5.*"
ureq = { version = "3.1.*", features = ["rustls", "charset", "cookies", "brotli", "socks-proxy"] }
zip = { version = "5.*", features = ["deflate", "time"] }
ureq = { version = "3.2.*", features = ["rustls", "charset", "cookies", "brotli", "socks-proxy"] }
zip = { version = "8.*", features = ["deflate", "deflate64", "time"] }
indicatif = "^0.18"
chrono = "^0.4.*"
glob = "0.3.*"
Expand All @@ -45,6 +45,7 @@ crossbeam-channel = "0.5.*"
crossbeam-utils = "0.8.*"
ctrlc = { version = "3.5.*", features = ["termination"] }
dotenvy = "0.15.*"
serde_json = "1.*"

# standard crate data is left out
[dev-dependencies]
Expand Down
22 changes: 15 additions & 7 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ dependencies = ["test-basic", "test-docker"]

#region Docker

[env]
#? Choose the Solr image tag to use in the docker container passing TAG like:
## cargo make --env TAG=9-slim test
TAG="slim"
#? Choose the Solr run mode: standalone, cloud, precreate, demo, testing
## cargo make --env MODE=cloud test
MODE="testing"

[tasks.compose-up]
category = "Test"
description = "Runs the command `docker compose up` to create a container running Solr for use in testing"
Expand Down Expand Up @@ -83,7 +91,7 @@ args = [
"./docker/docker-compose.yml",
"exec",
"solr",
"solr-ingest-all",
"solr-ingest-examples",
]

#endregion Docker
Expand All @@ -96,7 +104,7 @@ description = "Runs tests that do not require a Solr container"
command = "cargo"
args = ["test"]

[tasks.test-start]
[tasks.test-begin]
category = "Test"
description = "Setup a local Solr container and ingest some documents allowing to run tests manually after"
dependencies = ["compose-up", "compose-ingest"]
Expand All @@ -106,7 +114,7 @@ category = "Test"
description = "Cleanup the local Solr container after testing"
dependencies = ["compose-down"]

[tasks.test-solr]
[tasks.test-full]
category = "Test"
description = "Runs tests against an existing local solr server"
command = "cargo"
Expand All @@ -117,8 +125,8 @@ category = "Test"
description = "Setup a local Solr container, ingest some documents, run all tests, and cleanup the container"
private = true
run_task = { name = [
"test-start",
"test-solr",
"test-begin",
"test-full",
], fork = true, cleanup_task = "compose-down" }

#endregion Test
Expand Down Expand Up @@ -151,9 +159,9 @@ args = ["llvm-cov", "--all-features", "--html", "--output-dir", "target/coverage

[tasks.coverage]
category = "Test Coverage"
description = "Setu Solr container, generate a coverage report, and cleanup"
description = "Setup Solr container, generate a coverage report, and cleanup"
run_task = { name = [
"test-start",
"test-begin",
"coverage-full",
], fork = true, cleanup_task = "compose-down" }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Please also [check all available tasks](#available-tasks).
# This command creates the container with a solr server with two cores: 'demo' and 'target'
$ docker compose -f docker/docker-compose.yml up -d
# Run this command to insert some data into the cores
$ docker compose exec solr solr-ingest-all
$ docker compose exec solr solr-ingest-examples
# Run this command to test backup
$ cargo run -- backup --url http://localhost:8983/solr --core demo --dir $PWD
# Run this command to test restoring the backukp data into a existing empty core
Expand Down
2 changes: 2 additions & 0 deletions docker/configuration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Ignore all files in the volume directory
*
Loading
Loading