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

Self-Test: Run nginx #699

Merged
merged 1 commit into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions build_docs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ BEGIN
}

use lib 'lib';
use Proc::PID::File;
die "$0 already running\n"
if Proc::PID::File->running( dir => '.run' );

Copy link

@ghost ghost Mar 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PID files are lock files, and lock files are trouble. Good riddance.

I usually try to do some tricky integration interrogation of the process list to avoid PID files, and thus stale locks. The output of ps -eo comm and ps -eo command are favorites of mine.

use ES::Util qw(
run $Opts
Expand Down
22 changes: 20 additions & 2 deletions integtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ check: \
relative_conf_file \
keep_hash \
sub_dir \
keep_hash_and_sub_dir
keep_hash_and_sub_dir \
open_all

.PHONY: style
style: html_diff
Expand Down Expand Up @@ -234,6 +235,23 @@ keep_hash_and_sub_dir:
git clone $(TMP)/dest.git $(TMP)/dest
$(call GREP,'extra extra extra',$(TMP)/dest/html/test/current/_chapter.html)

.PHONY: open_all
open_all:
# Test that `--all --open` starts nginx in a usable way.
rm -rf $(TMP)
$(SETUP_MINIMAL_ALL)
/docs_build/build_docs.pl --in_standard_docker --all \
--target_repo $(TMP)/dest.git \
--conf $(TMP)/conf.yaml --open | tee $(TMP)/out &
curl -I --retry 10 --retry-connrefused http://127.0.0.1:8000/guide/
mkdir $(TMP)/guide
curl -sS http://127.0.0.1:8000/guide/ > $(TMP)/guide/index.html
$(call GREP,'Test book',$(TMP)/guide/index.html)
curl -sSI http://127.0.0.1:8000/guide/reference/setup > $(TMP)/guide/rdir
$(call GREP,'301 Moved Permanently',$(TMP)/guide/rdir)
$(call GREP,'Location: http://localhost:8000/guide/en/elasticsearch/reference/current/setup.html',$(TMP)/guide/rdir)
kill -QUIT $$(cat /run/nginx/nginx.pid)

define GREP=
# grep for a string in a file, outputting the whole file if there isn't
# a match.
Expand All @@ -258,7 +276,7 @@ define SETUP_MINIMAL_ALL=
# the filesystem just fine.
git init --bare $(TMP)/dest.git

# Actually build the docs
# Setup the config
sed 's|--tmp--|$(TMP)|' small_conf.yaml > $(TMP)/conf.yaml
endef

Expand Down