File tree 4 files changed +53
-9
lines changed 4 files changed +53
-9
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,26 @@ matrix:
115
115
- TRAVIS_RUST_VERSION=nightly
116
116
- REGULAR_TEST=false
117
117
- CODE_COVERAGE=true
118
+ - name : test WASM
119
+ language : python
120
+ python : 3.6
121
+ cache :
122
+ pip : true
123
+ # Because we're using the Python Travis environment, we can't use
124
+ # the built-in cargo cacher
125
+ directories :
126
+ - /home/travis/.cargo
127
+ - target
128
+ addons :
129
+ firefox : latest
130
+ install :
131
+ - nvm install node
132
+ - pip install pipenv
133
+ script :
134
+ - wasm/tests/.travis-runner.sh
135
+ env :
136
+ - REGULAR_TEST=true
137
+ - TRAVIS_RUST_VERSION=stable
118
138
allow_failures :
119
139
- rust : nightly
120
140
env : REGULAR_TEST=true
Original file line number Diff line number Diff line change 16
16
"raw-loader" : " ^1.0.0" ,
17
17
"webpack" : " ^4.16.3" ,
18
18
"webpack-cli" : " ^3.1.0" ,
19
- "webpack-dev-server" : " ^3.1.5"
19
+ "webpack-dev-server" : " ^3.1.5" ,
20
+ "start-server-and-test" : " ^1.7.11"
20
21
},
21
22
"scripts" : {
22
23
"dev" : " webpack-dev-server -d" ,
23
24
"build" : " webpack" ,
24
- "dist" : " webpack --mode production"
25
+ "dist" : " webpack --mode production" ,
26
+ "test" : " cd ../tests; pipenv run pytest" ,
27
+ "ci" : " start-server-and-test dev http-get://localhost:8080 test"
25
28
},
26
29
"repository" : {
27
30
"type" : " git" ,
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -eux
2
+ # This script is intended to be run in Travis from the root of the repository
3
+
4
+ # Install Rust
5
+ curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y
6
+ export PATH=$HOME /.cargo/bin:$PATH
7
+
8
+ # install wasm-pack
9
+ if [ ! -f $HOME /.cargo/bin/wasm-pack ]; then
10
+ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
11
+ fi
12
+
13
+ # install geckodriver
14
+ wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
15
+ mkdir geckodriver
16
+ tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
17
+ export PATH=$PATH :$PWD /geckodriver
18
+
19
+ # Install pipenv
20
+ pip install pipenv
21
+ (cd wasm/tests; pipenv install)
22
+
23
+ (cd wasm/demo; npm install; npm run ci)
Original file line number Diff line number Diff line change 1
1
import time
2
2
3
3
from selenium import webdriver
4
- from selenium .webdriver .chrome .options import Options
4
+ from selenium .webdriver .firefox .options import Options
5
5
import pytest
6
6
7
7
RUN_CODE_TEMPLATE = """
19
19
@pytest .fixture (scope = "module" )
20
20
def driver (request ):
21
21
options = Options ()
22
- options .headless = True
23
- options .add_argument ('--disable-gpu' )
24
- driver = webdriver .Chrome (options = options )
22
+ options .add_argument ('-headless' )
23
+ driver = webdriver .Firefox (options = options )
25
24
driver .get ("http://localhost:8080" )
26
- assert "RustPython" in driver .title
27
25
time .sleep (5 )
28
26
yield driver
29
- driver .close ()
30
-
27
+ driver .close ()
28
+
31
29
32
30
@pytest .mark .parametrize ("script, output" ,
33
31
[
You can’t perform that action at this time.
0 commit comments