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:
136136 uses : mymindstorm/setup-emsdk@v11
137137 with :
138138 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
140142 if : ${{ github.ref != 'refs/heads/master' }}
141143 run : export CMAKE_DJINNI_OPT="-DDJINNI_EXECUTABLE=$(pwd)/bin/djinni"
142144 - name : Report cmake version
@@ -145,7 +147,12 @@ jobs:
145147 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
146148 - name : Build release
147149 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
149156
150157 build-on-windows-for-cppcli :
151158 runs-on : windows-latest
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ if(DJINNI_WITH_WASM)
7171 )
7272
7373 set (WASM_CC_FLAGS "-s MAIN_MODULE=1 -fexceptions" )
74- message (WARNING ${WASM_CC_FLAGS} )
7574 set_target_properties (${DjinniTextsortWasm} PROPERTIES COMPILE_FLAGS ${WASM_CC_FLAGS} )
7675
7776 string (JOIN " " EMSCRIPTEN_LINK_OPTIONS
@@ -83,7 +82,6 @@ if(DJINNI_WITH_WASM)
8382 )
8483
8584 set (WASM_LINK_FLAGS "${EMSCRIPTEN_LINK_OPTIONS} -fexceptions" )
86- message (WARNING ${WASM_LINK_FLAGS} )
8785 set_target_properties (${DjinniTextsortWasm} PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS} )
8886 set (CMAKE_EXECUTABLE_SUFFIX ".js" )
8987
Original file line number Diff line number Diff line change 11cffi == 1.14.5
22future == 0.18.2
33pytest == 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)
240240 )
241241
242242 set (WASM_CC_FLAGS "-s MAIN_MODULE=1 -fexceptions" )
243- message (WARNING ${WASM_CC_FLAGS} )
244243 set_target_properties (${DjinniWasmTest} PROPERTIES COMPILE_FLAGS ${WASM_CC_FLAGS} )
245244
246245 string (JOIN " " EMSCRIPTEN_LINK_OPTIONS
@@ -252,7 +251,6 @@ if(DJINNI_WITH_WASM)
252251 )
253252
254253 set (WASM_LINK_FLAGS "${EMSCRIPTEN_LINK_OPTIONS} -fexceptions" )
255- message (WARNING ${WASM_LINK_FLAGS} )
256254 set_target_properties (${DjinniWasmTest} PROPERTIES LINK_FLAGS ${WASM_LINK_FLAGS} )
257255 set (CMAKE_EXECUTABLE_SUFFIX ".js" )
258256
Original file line number Diff line number Diff line change 77import sys
88import threading
99
10- port = 8089
10+ port = "8080"
1111httpd = HTTPServer (("127.0.0.1" , int (port )), SimpleHTTPRequestHandler )
1212
1313def run_server ():
@@ -19,16 +19,19 @@ def run_server():
1919
2020service = Service (executable_path = r'/usr/bin/chromedriver' )
2121options = webdriver .ChromeOptions ()
22- # options.add_argument('--headless')
22+ options .add_argument ('--headless' )
2323options .add_argument ('--no-sandbox' )
2424options .add_argument ('--disable-dev-shm-usage' )
2525options .add_argument ('--disable-gpu' )
2626driver = webdriver .Chrome (service = service , options = options )
2727print (f"connecting web driver to http://localhost:{ port } /" )
2828driver .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 )
3132driver .quit ()
32- finished_tests = True
3333httpd .shutdown ()
3434server_thread .join ()
35+ if len (failed_elements ) > 0 :
36+ exit (1 )
37+ exit (0 )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ #! /usr/bin/env bash
23set -eu
4+ # compile TS
35tsc
6+ # bundle
47browserify 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