Skip to content

Commit

Permalink
initial step to add windows installer tests
Browse files Browse the repository at this point in the history
Co-authored-by: Sophia Guo <sophia.gwf@gmail.com>
Co-authored-by: Shelley Lambert <slambert@gmail.com>
  • Loading branch information
sophia-guo and smlambert committed Mar 8, 2023
1 parent 8687b39 commit 97a060c
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 0 deletions.
60 changes: 60 additions & 0 deletions test/functional/wintps/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0"?>

<!--
# Licensed 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
#
# https://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.
-->

<project name="WinTPS Installer tests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
WinTPS Installer tests
</description>

<!-- set global properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/wintps" />

<!--Properties for this particular build-->
<property name="src" location="./" />

<target name="wintpsTest.check">
<condition property="wintpsTestdir.exists">
<available file="WinTPSTest" type="dir"/>
</condition>
</target>

<target name="getWinTPSTest" depends="wintpsTest.check" unless="wintpsTestdir.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="https://github.com/RadekCap/WindowsTPS" />
</exec>
</target>

<target name="init">
<mkdir dir="${DEST}" />
</target>

<target name="dist" depends="init,getWinTPSTest" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml,*.sh" />
</copy>
</target>

<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>

<target name="build" >
<antcall target="clean" inheritall="true" />
</target>
</project>
30 changes: 30 additions & 0 deletions test/functional/wintps/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
# Licensed 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
#
# https://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.
-->
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../TKG/playlist.xsd">
<test>
<testCaseName>WinTPSTests</testCaseName>
<command>$(CD) $(TEST_ROOT)$(D)functional$(D)wintps; $(TEST_ROOT)$(D)functional$(D)wintps$(D)runInstallerTests.sh $(REPORTDIR) ${JDK_VERSION}; \
$(TEST_STATUS)</command>
<impls>
<impl>hotspot</impl>
</impls>
<levels>
<level>dev</level>
</levels>
<groups>
<group>functional</group>
</groups>
</test>
</playlist>
31 changes: 31 additions & 0 deletions test/functional/wintps/runInstallerTests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# Licensed 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
#
# https://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.

set -x
set -eo pipefail

export RESULTS_FOLDER=$1/result
export INPUT_FOLDER=$1/input

#mkdir $RESULTS_FOLDER
mkdir $INPUT_FOLDER
export JDK_VERSION=$2
export MSI_VENDOR="Adoptium"
export CURRENT_USER_NAME='jenkins'

echo "Fetch the MSI file"
curl -OLJSks "https://api.adoptium.net/v3/installer/latest/$JDK_VERSION/ga/windows/x64/jdk/hotspot/normal/eclipse?project=jdk"
mv *.msi $INPUT_FOLDER/
ls $INPUT_FOLDER
./WindowsTPS/wrapper/run-tps-win-vagrant.sh

0 comments on commit 97a060c

Please sign in to comment.