Skip to content

Commit

Permalink
Merge pull request #18 from mkalkbrenner/upload_test
Browse files Browse the repository at this point in the history
Upload test
  • Loading branch information
mkalkbrenner committed Jul 5, 2023
2 parents 094aafc + dae5135 commit ffe1c06
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +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
# 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 @@ -35,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

0 comments on commit ffe1c06

Please sign in to comment.