forked from community-security-team/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LRQA-54968 Clean up indices print logic
- Loading branch information
1 parent
b613c27
commit b62d1f5
Showing
2 changed files
with
73 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2691,6 +2691,70 @@ ${tomcat-gc-log} | |
</sequential> | ||
</macrodef> | ||
|
||
<macrodef name="print-search-indices"> | ||
<sequential> | ||
<get-testcase-property property.name="solr.enabled" /> | ||
<propertycopy from="search.engine[${env.CI_TEST_SUITE}]" name="suite.search.engine" silent="true" /> | ||
|
||
<if> | ||
<or> | ||
<equals arg1="${solr.enabled}" arg2="true" /> | ||
<equals arg1="${suite.search.engine}" arg2="solr" /> | ||
</or> | ||
<then> | ||
<ant antfile="build-test-solr.xml" target="print-solr-indices" /> | ||
</then> | ||
<else> | ||
<get-testcase-property property.name="test.name.skip.portal.instance" /> | ||
|
||
<if> | ||
<and> | ||
<not> | ||
<isset property="test.name.skip.portal.instance" /> | ||
</not> | ||
<equals arg1="test.portal.instance" arg2="true" /> | ||
</and> | ||
<then> | ||
<var name="portalInstanceName" value="${env.HOSTNAME}" /> | ||
</then> | ||
<else> | ||
<var name="portalInstanceName" value="localhost" /> | ||
</else> | ||
</if> | ||
|
||
<exec executable="curl" outputproperty="companyId"> | ||
<arg value="http://localhost:8080/api/jsonws/company/get-company-by-virtual-host/virtual-host/${portalInstanceName}" /> | ||
<arg value="-u" /> | ||
<arg value="[email protected]:test" /> | ||
</exec> | ||
|
||
<propertyregex | ||
input="${companyId}" | ||
override="true" | ||
property="companyId" | ||
regexp="(?<=companyId":")(.*)(?=","home)" | ||
select="\1" | ||
/> | ||
|
||
<get-testcase-property property.name="osgi.app.includes" /> | ||
|
||
<if> | ||
<or> | ||
<equals arg1="${suite.search.engine}" arg2="elasticsearch7" /> | ||
<contains string="${osgi.app.includes}" substring="portal-search-elasticsearch7" /> | ||
</or> | ||
<then> | ||
<ant antfile="build-test-elasticsearch7.xml" target="print-elasticsearch-indices" /> | ||
</then> | ||
<else> | ||
<ant antfile="build-test-elasticsearch6.xml" target="print-elasticsearch-indices" /> | ||
</else> | ||
</if> | ||
</else> | ||
</if> | ||
</sequential> | ||
</macrodef> | ||
|
||
<macrodef name="record-git-commit-plugins"> | ||
<sequential> | ||
<beanshell> | ||
|
@@ -12309,116 +12373,10 @@ url=${short.hostname}:8080</echo> | |
</then> | ||
</if> | ||
|
||
<print-search-indices /> | ||
|
||
<trycatch property="shutdown.error"> | ||
<try> | ||
<get-testcase-property property.name="solr.enabled" /> | ||
|
||
<if> | ||
<not> | ||
<equals arg1="${solr.enabled}" arg2="true" /> | ||
</not> | ||
<then> | ||
<get-testcase-property property.name="test.name.skip.portal.instance" /> | ||
|
||
<if> | ||
<and> | ||
<not> | ||
<isset property="test.name.skip.portal.instance" /> | ||
</not> | ||
<equals arg1="test.portal.instance" arg2="true" /> | ||
</and> | ||
<then> | ||
<var name="portalInstanceName" value="${env.HOSTNAME}" /> | ||
</then> | ||
<else> | ||
<var name="portalInstanceName" value="localhost" /> | ||
</else> | ||
</if> | ||
|
||
<exec executable="curl" outputproperty="companyId"> | ||
<arg value="http://localhost:8080/api/jsonws/company/get-company-by-virtual-host/virtual-host/${portalInstanceName}" /> | ||
<arg value="-u" /> | ||
<arg value="[email protected]:test" /> | ||
</exec> | ||
|
||
<propertyregex | ||
input="${companyId}" | ||
override="true" | ||
property="companyId" | ||
regexp="(?<=companyId":")(.*)(?=","home)" | ||
select="\1" | ||
/> | ||
|
||
<get-testcase-property property.name="portal.suite.search.engine" /> | ||
<get-testcase-property property.name="remote.elasticsearch.enabled" /> | ||
|
||
<if> | ||
<contains string="${env.CI_TEST_SUITE}" substring="search" /> | ||
<then> | ||
<propertycopy from="search.engine[${env.CI_TEST_SUITE}]" name="suite.search.engine" silent="true" /> | ||
|
||
<if> | ||
<and> | ||
<not> | ||
<isset property="remote.elasticsearch.enabled" /> | ||
</not> | ||
<equals arg1="${suite.search.engine}" arg2="elasticsearch7" /> | ||
</and> | ||
<then> | ||
<ant antfile="build-test-elasticsearch7.xml" target="print-elasticsearch-indices" /> | ||
</then> | ||
<elseif> | ||
<not> | ||
<equals arg1="${suite.search.engine}" arg2="solr" /> | ||
</not> | ||
<then> | ||
<ant antfile="build-test-elasticsearch6.xml" target="print-elasticsearch-indices" /> | ||
</then> | ||
</elseif> | ||
</if> | ||
</then> | ||
<else> | ||
<if> | ||
<and> | ||
<not> | ||
<isset property="remote.elasticsearch.enabled" /> | ||
</not> | ||
<equals arg1="${portal.suite.search.engine}" arg2="elasticsearch7" /> | ||
</and> | ||
<then> | ||
<ant antfile="build-test-elasticsearch7.xml" target="print-elasticsearch-indices" /> | ||
</then> | ||
<else> | ||
<ant antfile="build-test-elasticsearch6.xml" target="print-elasticsearch-indices" /> | ||
</else> | ||
</if> | ||
</else> | ||
</if> | ||
</then> | ||
</if> | ||
|
||
<get-testcase-property property.name="solr.enabled" /> | ||
|
||
<if> | ||
<equals arg1="${solr.enabled}" arg2="true" /> | ||
<then> | ||
<ant antfile="build-test-solr.xml" target="print-solr-indices" /> | ||
</then> | ||
<elseif> | ||
<isset property="env.CI_TEST_SUITE" /> | ||
<then> | ||
<propertycopy from="search.engine[${env.CI_TEST_SUITE}]" name="suite.search.engine" silent="true" /> | ||
|
||
<if> | ||
<equals arg1="${suite.search.engine}" arg2="solr" /> | ||
<then> | ||
<ant antfile="build-test-solr.xml" target="print-solr-indices" /> | ||
</then> | ||
</if> | ||
</then> | ||
</elseif> | ||
</if> | ||
|
||
<antcall target="clean-up-logs" /> | ||
|
||
<record action="start" name="${project.dir}/console-shut-down" /> | ||
|