From 88e0856e40b05b8d846928f5356b7f06cd60adf2 Mon Sep 17 00:00:00 2001 From: Jonas Baumann Date: Mon, 8 Jul 2019 14:59:02 +0200 Subject: [PATCH 1/3] Run tests on jenkins. Fix buildout so that jenkins can actually run the tests. --- ftw/recipe/solr/README.txt | 4 ++++ test-buildout-2.x.cfg | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ftw/recipe/solr/README.txt b/ftw/recipe/solr/README.txt index 9e33b55..080e51e 100644 --- a/ftw/recipe/solr/README.txt +++ b/ftw/recipe/solr/README.txt @@ -24,6 +24,10 @@ We'll start by creating a simple buildout that uses our recipe:: Running the buildout gives us:: >>> print system(buildout) + Getting distribution for 'jinja2'. + Got Jinja2 2.10.1. + Getting distribution for 'zc.recipe.egg>=2.0.6'. + Got zc.recipe.egg 2.0.7. Installing solr. Downloading http://test.server/solr-7.2.1.tgz diff --git a/test-buildout-2.x.cfg b/test-buildout-2.x.cfg index f95281a..e54ce03 100644 --- a/test-buildout-2.x.cfg +++ b/test-buildout-2.x.cfg @@ -1,8 +1,9 @@ [buildout] -develop = . -parts = test - -[test] -recipe = zc.recipe.testrunner -eggs = ftw.recipe.solr [tests] +extends = + http://dist.plone.org/release/4-latest/versions.cfg + https://raw.github.com/4teamwork/ftw-buildouts/master/test-package.cfg + https://raw.githubusercontent.com/4teamwork/ftw-buildouts/master/test-versions.cfg + https://raw.githubusercontent.com/4teamwork/ftw-buildouts/master/test-versions-plone-4.cfg +jenkins_python = $PYTHON27 +package-name = ftw.recipe.solr From 9da1746d2c4388d1e5a6a78ac83ee7f7a81af024 Mon Sep 17 00:00:00 2001 From: Jonas Baumann Date: Mon, 8 Jul 2019 15:02:04 +0200 Subject: [PATCH 2/3] Rename bootstrap.py --- bootstrap-buildout.py => bootstrap.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bootstrap-buildout.py => bootstrap.py (100%) diff --git a/bootstrap-buildout.py b/bootstrap.py similarity index 100% rename from bootstrap-buildout.py rename to bootstrap.py From b686c83fbba8b05ce217901d62cef76df6ee5d68 Mon Sep 17 00:00:00 2001 From: Thomas Buchberger Date: Mon, 8 Jul 2019 15:18:05 +0200 Subject: [PATCH 3/3] Fix tests for log4j configuration --- ftw/recipe/solr/README.txt | 104 +++++++++++++++++++++++++++---------- 1 file changed, 77 insertions(+), 27 deletions(-) diff --git a/ftw/recipe/solr/README.txt b/ftw/recipe/solr/README.txt index 080e51e..197b545 100644 --- a/ftw/recipe/solr/README.txt +++ b/ftw/recipe/solr/README.txt @@ -37,7 +37,7 @@ We should have a Solr distribution in the parts directory:: >>> ls(sample_buildout, 'parts', 'solr') d contrib d dist - - log4j.properties + - log4j2.xml d server We should also have a Solr home directory:: @@ -69,37 +69,87 @@ The conf direcotry should contain a basic set of Solr configuration files:: - stopwords.txt - synonyms.txt -Our custom log4j.properties file should configure a log file in var/log:: +Our custom log4j2.xml file should configure a log file in var/log:: - >>> cat(sample_buildout, 'parts', 'solr', 'log4j.properties') - # Default Solr log4j config - # rootLogger log level may be programmatically overridden by -Dsolr.log.level - log4j.rootLogger=INFO, file, CONSOLE + >>> cat(sample_buildout, 'parts', 'solr', 'log4j2.xml') + + - #- File to log to and log format - log4j.appender.file.File=/sample-buildout/var/log/solr.log - log4j.appender.file.layout=org.apache.log4j.EnhancedPatternLayout - log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n + + + - # Adjust logging levels that should differ from root logger - log4j.logger.org.apache.zookeeper=WARN - log4j.logger.org.apache.hadoop=WARN - log4j.logger.org.eclipse.jetty=WARN - log4j.logger.org.eclipse.jetty.server.Server=INFO - log4j.logger.org.eclipse.jetty.server.ServerConnector=INFO + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + - # set to INFO to enable infostream log messages - log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + + + + %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n + + + + + + + + + + + + + + + + + + + + + + + + + We should also have a startup script:: @@ -129,7 +179,7 @@ We should also have a startup script:: -Dsolr.solr.home=$SOLR_HOME \ -Dsolr.install.dir=$SOLR_INSTALL_DIR \ -Dsolr.log.dir=/sample-buildout/var/log \ - -Dlog4j.configuration=/sample-buildout/parts/solr/log4j.properties) + -Dlog4j.configuration=/sample-buildout/parts/solr/log4j2.xml) start() { cd "$SOLR_SERVER_DIR"