Merge pull request #3882 from matrix-org/travis/fix-tests
Fix layering of dependencies in riot-web and e2e tests
This commit is contained in:
commit
5cb0dc41b7
6 changed files with 43 additions and 48 deletions
|
@ -76,6 +76,7 @@ steps:
|
||||||
- docker#v3.0.1:
|
- docker#v3.0.1:
|
||||||
image: "matrixdotorg/riotweb-ci-e2etests-env:latest"
|
image: "matrixdotorg/riotweb-ci-e2etests-env:latest"
|
||||||
propagate-environment: true
|
propagate-environment: true
|
||||||
|
workdir: "/workdir/matrix-react-sdk"
|
||||||
|
|
||||||
- label: "🔧 Riot Tests"
|
- label: "🔧 Riot Tests"
|
||||||
agents:
|
agents:
|
||||||
|
@ -83,27 +84,16 @@ steps:
|
||||||
# webpack loves to gorge itself on resources.
|
# webpack loves to gorge itself on resources.
|
||||||
queue: "medium"
|
queue: "medium"
|
||||||
command:
|
command:
|
||||||
# Install chrome
|
|
||||||
- "echo '--- Installing Chrome'"
|
|
||||||
- "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -"
|
|
||||||
- "sh -c 'echo \"deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google.list'"
|
|
||||||
- "apt-get update"
|
|
||||||
- "apt-get install -y google-chrome-stable"
|
|
||||||
# TODO: Remove hacky chmod for BuildKite
|
# TODO: Remove hacky chmod for BuildKite
|
||||||
- "chmod +x ./scripts/ci/*.sh"
|
- "chmod +x ./scripts/ci/*.sh"
|
||||||
- "chmod +x ./scripts/*"
|
- "chmod +x ./scripts/*"
|
||||||
- "echo '--- Installing Dependencies'"
|
|
||||||
- "./scripts/ci/install-deps.sh"
|
|
||||||
- "echo '--- Running initial build steps'"
|
|
||||||
- "yarn build"
|
|
||||||
- "echo '+++ Running Tests'"
|
- "echo '+++ Running Tests'"
|
||||||
- "./scripts/ci/riot-unit-tests.sh"
|
- "./scripts/ci/riot-unit-tests.sh"
|
||||||
env:
|
|
||||||
CHROME_BIN: "/usr/bin/google-chrome-stable"
|
|
||||||
plugins:
|
plugins:
|
||||||
- docker#v3.0.1:
|
- docker#v3.0.1:
|
||||||
image: "node:10"
|
image: "node:10"
|
||||||
propagate-environment: true
|
propagate-environment: true
|
||||||
|
workdir: "/workdir/matrix-react-sdk"
|
||||||
|
|
||||||
- label: "🌐 i18n"
|
- label: "🌐 i18n"
|
||||||
command:
|
command:
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# script which is run by the CI build (after `yarn test`).
|
|
||||||
#
|
|
||||||
# clones riot-web develop and runs the tests against our version of react-sdk.
|
|
||||||
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
RIOT_WEB_DIR=riot-web
|
|
||||||
REACT_SDK_DIR=`pwd`
|
|
||||||
|
|
||||||
yarn link
|
|
||||||
|
|
||||||
scripts/fetchdep.sh vector-im riot-web
|
|
||||||
|
|
||||||
pushd "$RIOT_WEB_DIR"
|
|
||||||
|
|
||||||
yarn link matrix-js-sdk
|
|
||||||
yarn link matrix-react-sdk
|
|
||||||
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
popd
|
|
|
@ -21,15 +21,16 @@ handle_error() {
|
||||||
|
|
||||||
trap 'handle_error' ERR
|
trap 'handle_error' ERR
|
||||||
|
|
||||||
RIOT_WEB_DIR=riot-web
|
|
||||||
REACT_SDK_DIR=`pwd`
|
|
||||||
|
|
||||||
|
|
||||||
echo "--- Building Riot"
|
echo "--- Building Riot"
|
||||||
scripts/ci/build.sh
|
scripts/ci/layered-riot-web.sh
|
||||||
|
cd ../riot-web
|
||||||
|
riot_web_dir=`pwd`
|
||||||
|
CI_PACKAGE=true yarn build
|
||||||
|
cd ../matrix-react-sdk
|
||||||
# run end to end tests
|
# run end to end tests
|
||||||
pushd test/end-to-end-tests
|
pushd test/end-to-end-tests
|
||||||
ln -s $REACT_SDK_DIR/$RIOT_WEB_DIR riot/riot-web
|
ln -s $riot_web_dir riot/riot-web
|
||||||
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh
|
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh
|
||||||
# CHROME_PATH=$(which google-chrome-stable) ./run.sh
|
# CHROME_PATH=$(which google-chrome-stable) ./run.sh
|
||||||
echo "--- Install synapse & other dependencies"
|
echo "--- Install synapse & other dependencies"
|
||||||
|
|
31
scripts/ci/layered-riot-web.sh
Normal file
31
scripts/ci/layered-riot-web.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Creates an environment similar to one that riot-web would expect for
|
||||||
|
# development. This means going one directory up (and assuming we're in
|
||||||
|
# a directory like /workdir/matrix-react-sdk) and putting riot-web and
|
||||||
|
# the js-sdk there.
|
||||||
|
|
||||||
|
cd ../ # Assume we're at something like /workdir/matrix-react-sdk
|
||||||
|
|
||||||
|
# Set up the js-sdk first
|
||||||
|
matrix-react-sdk/scripts/fetchdep.sh matrix-org matrix-js-sdk
|
||||||
|
pushd matrix-js-sdk
|
||||||
|
yarn link
|
||||||
|
yarn install
|
||||||
|
popd
|
||||||
|
|
||||||
|
# Now set up the react-sdk
|
||||||
|
pushd matrix-react-sdk
|
||||||
|
yarn link matrix-js-sdk
|
||||||
|
yarn link
|
||||||
|
yarn install
|
||||||
|
popd
|
||||||
|
|
||||||
|
# Finally, set up riot-web
|
||||||
|
matrix-react-sdk/scripts/fetchdep.sh vector-im riot-web
|
||||||
|
pushd riot-web
|
||||||
|
yarn link matrix-js-sdk
|
||||||
|
yarn link matrix-react-sdk
|
||||||
|
yarn install
|
||||||
|
yarn build:res
|
||||||
|
popd
|
|
@ -6,9 +6,7 @@
|
||||||
|
|
||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
RIOT_WEB_DIR=riot-web
|
scripts/ci/layered-riot-web.sh
|
||||||
|
cd ../riot-web
|
||||||
scripts/ci/build.sh
|
yarn build:genfiles # so the tests can run. Faster version of `build`
|
||||||
pushd "$RIOT_WEB_DIR"
|
|
||||||
yarn test
|
yarn test
|
||||||
popd
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ clone() {
|
||||||
if [ -n "$branch" ]
|
if [ -n "$branch" ]
|
||||||
then
|
then
|
||||||
echo "Trying to use $org/$repo#$branch"
|
echo "Trying to use $org/$repo#$branch"
|
||||||
git clone git://github.com/$org/$repo.git $repo --branch "$branch" && exit 0
|
git clone git://github.com/$org/$repo.git $repo --branch "$branch" --depth 1 && exit 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue