-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5665b99
commit 744a2f2
Showing
7 changed files
with
388 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM ubuntu:16.04 as build | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
docker.io \ | ||
gcc \ | ||
git \ | ||
libssl-dev \ | ||
pkg-config \ | ||
xz-utils | ||
|
||
# Install dependencies for chromium browser | ||
RUN apt-get install -y \ | ||
gconf-service \ | ||
libasound2 \ | ||
libatk1.0-0 \ | ||
libatk-bridge2.0-0 \ | ||
libc6 \ | ||
libcairo2 \ | ||
libcups2 \ | ||
libdbus-1-3 \ | ||
libexpat1 \ | ||
libfontconfig1 \ | ||
libgbm-dev \ | ||
libgcc1 \ | ||
libgconf-2-4 \ | ||
libgdk-pixbuf2.0-0 \ | ||
libglib2.0-0 \ | ||
libgtk-3-0 \ | ||
libnspr4 \ | ||
libpango-1.0-0 \ | ||
libpangocairo-1.0-0 \ | ||
libstdc++6 \ | ||
libx11-6 \ | ||
libx11-xcb1 \ | ||
libxcb1 \ | ||
libxcomposite1 \ | ||
libxcursor1 \ | ||
libxdamage1 \ | ||
libxext6 \ | ||
libxfixes3 \ | ||
libxi6 \ | ||
libxrandr2 \ | ||
libxrender1 \ | ||
libxss1 \ | ||
libxtst6 \ | ||
fonts-liberation \ | ||
libappindicator1 \ | ||
libnss3 \ | ||
lsb-release \ | ||
xdg-utils \ | ||
wget | ||
|
||
# Install rust | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain nightly --no-modify-path --profile minimal | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
RUN curl -sL https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-x64.tar.xz | tar -xJ | ||
ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}" | ||
ENV NODE_PATH="/node-v14.4.0-linux-x64/lib/node_modules/" | ||
|
||
WORKDIR /build | ||
|
||
COPY .env.sample .env | ||
|
||
RUN source .env | ||
RUN mkdir out | ||
|
||
# For now, we need to use `--unsafe-perm=true` to go around an issue when npm tries | ||
# to create a new folder. For reference: | ||
# https://github.com/puppeteer/puppeteer/issues/375 | ||
# | ||
# We also specify the version in case we need to update it to go around cache limitations. | ||
RUN npm install -g [email protected] --unsafe-perm=true | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "/build/out/gui-tests/tester.js"] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Just in case it's running, we stop the web server. | ||
docker-compose stop web | ||
|
||
docker-compose up -d db s3 | ||
|
||
# We add the information we need. | ||
cargo run -- database migrate | ||
cargo run -- build crate sysinfo 0.23.4 | ||
cargo run -- build crate sysinfo 0.23.5 | ||
cargo run -- build add-essential-files | ||
cargo run -- start-web-server & | ||
SERVER_PID=$! | ||
|
||
docker build . -f dockerfiles/Dockerfile-gui-tests -t gui_tests | ||
|
||
echo "Sleeping a bit to be sure the web server will be started..." | ||
sleep 5 | ||
|
||
# status="docker run . -v `pwd`:/build/out:ro gui_tests" | ||
docker-compose run gui_tests | ||
status=$? | ||
kill -9 $SERVER_PID | ||
exit $status |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Checks the content of the 404 page. | ||
goto: |DOC_PATH|/non-existing-crate | ||
assert-text: ("#crate-title", "The requested crate does not exist") |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Checks that the "latest" URL leads us to the last version of the `sysinfo` crate. | ||
goto: |DOC_PATH|/sysinfo | ||
// We first check if the redirection worked as expected: | ||
assert-document-property: ({"URL": "/sysinfo/latest/sysinfo/"}, ENDS_WITH) | ||
assert: "//*[@class='title' and text()='sysinfo-0.23.5']" | ||
// And we also confirm we're on a rustdoc page. | ||
assert: "#rustdoc_body_wrapper" | ||
|
||
// Let's go to the docs.rs page of the crate. | ||
goto: |DOC_PATH|/crate/sysinfo/latest | ||
assert-false: "#rustdoc_body_wrapper" | ||
assert-text: ("#crate-title", "sysinfo 0.23.5", CONTAINS) |
Oops, something went wrong.