Skip to content
Open
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
28 changes: 28 additions & 0 deletions build-test-weblogic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,32 @@

<lstopwatch action="total" name="run.weblogic" />
</target>

<target name="setup-weblogic-playwright">
<lstopwatch action="start" name="setup.weblogic" />

<app-server-properties-update>
app.server.type=weblogic
</app-server-properties-update>

<set-app-server-version-number app.server.type="weblogic" app.server.version="15.1.1" />

<antcall target="prepare-osgi-module-configurations" />

<antcall target="prepare-portal-properties" />

<antcall target="prepare-portal-ext-properties" />

<antcall target="prepare-portlet-ext-properties" />

<antcall target="prepare-system-ext-properties" />

<prepare-app-server-configuration />

<prepare-database-jndi />

<antcall target="clean-app-server-deploy-dir" />
Comment on lines +60 to +74
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The use of multiple consecutive <antcall> tasks is inefficient because each call creates a new Ant project instance, which can negatively impact build performance. For better performance and maintainability, consider refactoring this to use target dependencies (depends attribute) to create an execution chain. If modifying the dependency targets is not an option, you could create wrapper targets to define the sequence.


<lstopwatch action="total" name="setup.weblogic" />
</target>
</project>
14 changes: 5 additions & 9 deletions modules/test/playwright/env/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ function start_app_server {
/bin/bash catalina.sh run &
elif [[ "${APP_SERVER_TYPE}" == "weblogic" ]]
then
ant -f build-test-weblogic.xml setup-weblogic-playwright
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This ant command will fail because it's executed from the wrong directory. The start_app_server function changes the current directory to the app server's bin directory, but the build-test-weblogic.xml file is located at the project root (${_PORTAL_PROJECT_DIR}). You need to change to the project root before executing ant. Using a subshell (...) is recommended to avoid side effects on subsequent commands.

Suggested change
ant -f build-test-weblogic.xml setup-weblogic-playwright
(cd ${_PORTAL_PROJECT_DIR} && ant -f build-test-weblogic.xml setup-weblogic-playwright)


cd ${app_server_dir}/domains/liferay

/bin/bash startWeblogic.sh
Expand Down Expand Up @@ -676,19 +678,13 @@ function stop_app_server {

cd $(get_app_server_dir ${liferay_home})/bin

if [[ "${APP_SERVER_TYPE}" == "jboss" || "${APP_SERVER_TYPE}" == "wildfly" ]]
if [[ "${APP_SERVER_TYPE}" == "tomcat" ]]
then
/bin/bash shutdown.sh &
else
cd ${_PORTAL_PROJECT_DIR}

ant -f build-test.xml stop-app-server
elif [[ "${APP_SERVER_TYPE}" == "tomcat" ]]
then
/bin/bash shutdown.sh &
elif [[ "${APP_SERVER_TYPE}" == "weblogic" ]]
then
cd ${app_server_dir}/domains/liferay

/bin/bash startWeblogic.sh
fi

local portal_url=${2}
Expand Down