File tree Expand file tree Collapse file tree 6 files changed +24
-13
lines changed Expand file tree Collapse file tree 6 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ jobs:
136
136
uses : mymindstorm/setup-emsdk@v11
137
137
with :
138
138
version : 3.1.44
139
- - name : Use local djinni djinni
139
+ - name : Install chrome
140
+ uses : browser-actions/setup-chrome@latest
141
+ - name : Use local djinni on branch for now
140
142
if : ${{ github.ref != 'refs/heads/master' }}
141
143
run : export CMAKE_DJINNI_OPT="-DDJINNI_EXECUTABLE=$(pwd)/bin/djinni"
142
144
- name : Report cmake version
@@ -145,7 +147,12 @@ jobs:
145
147
run : cmake -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -S . -B build -DDJINNI_WITH_WASM=ON -DDJINNI_EXECUTABLE=$(pwd)/bin/djinni
146
148
- name : Build release
147
149
run : cmake --build build --parallel $(nproc) --config Release
148
-
150
+ - name : Run headless test
151
+ uses : coactions/setup-xvfb@v1
152
+ with :
153
+ run : ctest --output-on-failure
154
+ working-directory : build
155
+ options : # optional
149
156
150
157
build-on-windows-for-cppcli :
151
158
runs-on : windows-latest
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ if(DJINNI_WITH_WASM)
71
71
)
72
72
73
73
set (WASM_CC_FLAGS "-s MAIN_MODULE=1 -fexceptions" )
74
- message (WARNING ${WASM_CC_FLAGS} )
75
74
set_target_properties (${DjinniTextsortWasm} PROPERTIES COMPILE_FLAGS ${WASM_CC_FLAGS} )
76
75
77
76
string (JOIN " " EMSCRIPTEN_LINK_OPTIONS
@@ -83,7 +82,6 @@ if(DJINNI_WITH_WASM)
83
82
)
84
83
85
84
set (WASM_LINK_FLAGS "${EMSCRIPTEN_LINK_OPTIONS} -fexceptions" )
86
- message (WARNING ${WASM_LINK_FLAGS} )
87
85
set_target_properties (${DjinniTextsortWasm} PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS} )
88
86
set (CMAKE_EXECUTABLE_SUFFIX ".js" )
89
87
Original file line number Diff line number Diff line change 1
1
cffi == 1.14.5
2
2
future == 0.18.2
3
3
pytest == 6.2.5
4
+ selenium =4.15.2
Original file line number Diff line number Diff line change @@ -240,7 +240,6 @@ if(DJINNI_WITH_WASM)
240
240
)
241
241
242
242
set (WASM_CC_FLAGS "-s MAIN_MODULE=1 -fexceptions" )
243
- message (WARNING ${WASM_CC_FLAGS} )
244
243
set_target_properties (${DjinniWasmTest} PROPERTIES COMPILE_FLAGS ${WASM_CC_FLAGS} )
245
244
246
245
string (JOIN " " EMSCRIPTEN_LINK_OPTIONS
@@ -252,7 +251,6 @@ if(DJINNI_WITH_WASM)
252
251
)
253
252
254
253
set (WASM_LINK_FLAGS "${EMSCRIPTEN_LINK_OPTIONS} -fexceptions" )
255
- message (WARNING ${WASM_LINK_FLAGS} )
256
254
set_target_properties (${DjinniWasmTest} PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS} )
257
255
set (CMAKE_EXECUTABLE_SUFFIX ".js" )
258
256
Original file line number Diff line number Diff line change 7
7
import sys
8
8
import threading
9
9
10
- port = 8089
10
+ port = "8080"
11
11
httpd = HTTPServer (("127.0.0.1" , int (port )), SimpleHTTPRequestHandler )
12
12
13
13
def run_server ():
@@ -19,16 +19,19 @@ def run_server():
19
19
20
20
service = Service (executable_path = r'/usr/bin/chromedriver' )
21
21
options = webdriver .ChromeOptions ()
22
- # options.add_argument('--headless')
22
+ options .add_argument ('--headless' )
23
23
options .add_argument ('--no-sandbox' )
24
24
options .add_argument ('--disable-dev-shm-usage' )
25
25
options .add_argument ('--disable-gpu' )
26
26
driver = webdriver .Chrome (service = service , options = options )
27
27
print (f"connecting web driver to http://localhost:{ port } /" )
28
28
driver .get (f"http://localhost:{ port } /test.html" )
29
- #element = driver.find_element(By.NAME, "query")
30
- #assert element.is_enabled()
29
+ failed_elements = driver .find_elements (By .XPATH , "//pre[@id='output']/span[contains(text(), 'FAILED')]" )
30
+ for element in failed_elements :
31
+ print (f"{ element .text } " , file = sys .stderr )
31
32
driver .quit ()
32
- finished_tests = True
33
33
httpd .shutdown ()
34
34
server_thread .join ()
35
+ if len (failed_elements ) > 0 :
36
+ exit (1 )
37
+ exit (0 )
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
+ #! /usr/bin/env bash
2
3
set -eu
4
+ # compile TS
3
5
tsc
6
+ # bundle
4
7
browserify main.js -o bundle.js
5
- sleep 1 && python3 -mwebbrowser http://localhost:8000/test.html &
6
- python3 -m http.server
8
+ # then run the selenium tests
9
+ sleep 1 && python3 run-tests-selenium.py
10
+
You can’t perform that action at this time.
0 commit comments