Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests and make upload work, for #18, for #13 #19

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
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
16 changes: 11 additions & 5 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ setup() {
}

health_checks() {
ddev exec "curl -u solr:SolrRocks -s http://ddev-${PROJNAME}-solr:8983/solr/# | grep Admin"
ddev solr --help | grep COMMAND
curl -u solr:SolrRocks -X POST --header "Content-Type:application/octet-stream" --data-binary @{$DIR}/tests/testdata/techproducts_configset.zip "http://${PROJNAME}.ddev.site:8983/solr/admin/configs?action=UPLOAD&name=techproducts_configset"
curl -u solr:SolrRocks http://${PROJNAME}.ddev.site:8983/solr/admin/collections?action=CREATE&name=newCollection&numShards=1&replicationFactor=1&collection.configName=techproducts_configset
# Make sure the solr admin UI is working
ddev exec "curl -sSf -u solr:SolrRocks -s http://solr:8983/solr/# | grep Admin >/dev/null"
# Make sure the custom `ddev solr` command works
ddev solr --help | grep COMMAND >/dev/null
#echo "# curl -v -sSf -u solr:SolrRocks -X POST --header \"Content-Type:application/octet-stream\" --data-binary \"@${DIR}/tests/testdata/techproducts_configset.zip\" \"http://${PROJNAME}.ddev.site:8983/solr/admin/configs?action=UPLOAD&name=techproducts_configset\"" >&3
# Upload the techproducts configset
# Use `curl -v` to learn more about what's going wrong
curl -sSf -u solr:SolrRocks -X POST --header "Content-Type:application/octet-stream" --data-binary "@${DIR}/tests/testdata/techproducts_configset.zip" "http://${PROJNAME}.ddev.site:8983/solr/admin/configs?action=UPLOAD&name=techproducts_configset"
# Check to make sure the configset was uploaded and can be used
curl -v -sSf -u solr:SolrRocks "http://${PROJNAME}.ddev.site:8983/solr/admin/collections?action=CREATE&name=newCollection&numShards=1&replicationFactor=1&collection.configName=techproducts_configset"
}

teardown() {
Expand All @@ -37,7 +43,7 @@ teardown() {
@test "install from release" {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
echo "# ddev get ddev/ddev-solr with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
echo "# ddev get mkalkbrenner/ddev-solr with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get mkalkbrenner/ddev-solr
ddev restart >/dev/null
health_checks
Expand Down