janhoy commented on code in PR #5323: URL: https://github.com/apache/solr/pull/5323#discussion_r4552689978
########## solr/packaging/src/test/org/apache/solr/shell/AdminConsoleUrlsTest.java: ########## @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.solr.shell; + +import org.junit.Test; + +/** + * Port of {@code test_adminconsole_urls.bats}. + * + * <p>Kept close to the original, including the order of the tests and the text each asserts on. + * Where it differs: each test starts its own node, as the original does, because the last one needs + * a system property on the command line; the original's repeated {@code curl} calls against one URL + * (one for the status code, one for the headers, one for the body) collapse into a single {@code + * http()} request whose status, headers and body are all asserted; and every {@code solr start} and + * every header assertion also asserts the status, so a 404 cannot pass as a missing header. + */ +public class AdminConsoleUrlsTest extends SolrShellTestCase { + + @Test + public void assertAbleToLaunchSolrAdminConsole() { + run("solr start"); + + http("/solr/").assertStatus(200).assertHeaderContains("text/html").assertContains("<html"); Review Comment: If / when a test fails, it **will** output a terminal-like session with command + output until the last failing command which then gets a `FAILED: <reason>` trailer. So if you want to reproduce locally or something, it should not be much to edit to do so. But yea, it would be possible to add some controls around this presentation form. Initially it was all stack traces and java-level assert failures. So I'm pretty happy with a bit more human error log. But in the happy path the tests are very silent, only outputting one single "ok", "sipped", "FAIL" line per completed test, similar to BATS. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
