Make running the tests like in travis-ci easier (#92)
* Move testing logic from travis.yml to tests-ci.sh script This way we can share this logic between travis CI and other systems like for example a docker container. * Move logic to create a testing environment to tests-environment.sh As with the logic to execute the tests, this way we can share this logic with other systems to tests linuxdeployqt. * Install Qt also in tests-environment.sh No reason to keep it separate from the rest as far as I know * Wait until the X server is up and running Otherwise we get into a racy situation. * Add Dockerfile to create a testing container This container tries to emulate the environment we have in travis-ci, this way we can test whatever is failing on the CI locally.
This commit is contained in:
+2
-30
@@ -9,38 +9,10 @@ env:
|
|||||||
- DISPLAY=:99
|
- DISPLAY=:99
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo add-apt-repository --yes ppa:beineri/opt-qt58-trusty
|
- ./tests/tests-environment.sh
|
||||||
- sudo apt-get update -qq
|
|
||||||
- git clone https://github.com/NixOS/patchelf.git
|
|
||||||
- cd patchelf
|
|
||||||
- bash ./bootstrap.sh
|
|
||||||
- ./configure
|
|
||||||
- make -j2
|
|
||||||
- sudo make install
|
|
||||||
- cd -
|
|
||||||
- sudo wget -c "https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool
|
|
||||||
- sudo chmod a+x /usr/local/bin/appimagetool
|
|
||||||
|
|
||||||
install:
|
|
||||||
- sudo apt-get -y install qt58base qt58declarative qt58webengine binutils xpra
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- source /opt/qt*/bin/qt*-env.sh
|
- ./tests/tests-ci.sh
|
||||||
- /opt/qt*/bin/qmake linuxdeployqt.pro
|
|
||||||
|
|
||||||
- make -j2
|
|
||||||
|
|
||||||
- mkdir -p linuxdeployqt.AppDir/usr/bin/
|
|
||||||
- cp /usr/local/bin/patchelf linuxdeployqt.AppDir/usr/bin/
|
|
||||||
- cp /usr/local/bin/appimagetool linuxdeployqt.AppDir/usr/bin/
|
|
||||||
- find linuxdeployqt.AppDir/
|
|
||||||
- export VERSION=continuous
|
|
||||||
- cp ./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/usr/bin/
|
|
||||||
- ./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/linuxdeployqt.desktop -verbose=3 -appimage
|
|
||||||
- ls -lh
|
|
||||||
- find *.AppDir
|
|
||||||
- xpra start :99
|
|
||||||
- bash -e tests/tests.sh
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
# This container amins to offer a testing environment similar to the one we are
|
||||||
|
# creating in travis-ci so we can easily reproduce issues detected on our CI
|
||||||
|
# locally
|
||||||
|
#
|
||||||
|
# To use it, simply execute the container like this:
|
||||||
|
# docker run --rm -ti --privileged -v /path/to/linuxdeployqt:/linuxdeployqt bash
|
||||||
|
# and then execute tests/tests-ci.sh
|
||||||
|
|
||||||
|
FROM ubuntu:trusty
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get -y install software-properties-common wget build-essential \
|
||||||
|
autoconf git fuse libgl1-mesa-dev psmisc
|
||||||
|
|
||||||
|
COPY tests/tests-environment.sh /
|
||||||
|
|
||||||
|
RUN /tests-environment.sh
|
||||||
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
source /opt/qt*/bin/qt*-env.sh
|
||||||
|
/opt/qt*/bin/qmake linuxdeployqt.pro
|
||||||
|
make -j2
|
||||||
|
|
||||||
|
mkdir -p linuxdeployqt.AppDir/usr/bin/
|
||||||
|
cp /usr/local/bin/patchelf linuxdeployqt.AppDir/usr/bin/
|
||||||
|
cp /usr/local/bin/appimagetool linuxdeployqt.AppDir/usr/bin/
|
||||||
|
find linuxdeployqt.AppDir/
|
||||||
|
export VERSION=continuous
|
||||||
|
cp ./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/usr/bin/
|
||||||
|
./linuxdeployqt/linuxdeployqt linuxdeployqt.AppDir/linuxdeployqt.desktop -verbose=3 -appimage
|
||||||
|
ls -lh
|
||||||
|
find *.AppDir
|
||||||
|
xpra start :99
|
||||||
|
|
||||||
|
export DISPLAY=:99
|
||||||
|
|
||||||
|
until xset -q
|
||||||
|
do
|
||||||
|
echo "Waiting for X server to start..."
|
||||||
|
sleep 1;
|
||||||
|
done
|
||||||
|
|
||||||
|
bash -e tests/tests.sh
|
||||||
Executable
+20
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
sudo add-apt-repository --yes ppa:beineri/opt-qt58-trusty
|
||||||
|
sudo apt-get update -qq
|
||||||
|
|
||||||
|
git clone https://github.com/NixOS/patchelf.git
|
||||||
|
cd patchelf
|
||||||
|
bash ./bootstrap.sh
|
||||||
|
./configure
|
||||||
|
make -j2
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
cd -
|
||||||
|
|
||||||
|
sudo wget -c "https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool
|
||||||
|
sudo chmod a+x /usr/local/bin/appimagetool
|
||||||
|
|
||||||
|
sudo apt-get -y install qt58base qt58declarative qt58webengine binutils xpra
|
||||||
Reference in New Issue
Block a user