From 80456900cf01c0ffd929d6e6204f0ee648a005d2 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Sun, 19 Mar 2017 19:19:24 +0100 Subject: [PATCH 01/35] Add electron build to appveyor. --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index f25018304..8d7ab6c01 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -57,6 +57,10 @@ environment: platform: x64 msvs_toolset: 14 TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140 + - nodejs_version: 6 + platform: x64 + msvs_toolset: 12 + TOOLSET_ARGS: --runtime=electron --target=1.6.0 --dist-url=https://atom.io/download/electron os: Visual Studio 2015 From 325d7cdb378fc0c61bef6ca46166a731e87958a8 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Mon, 20 Mar 2017 19:39:21 +0100 Subject: [PATCH 02/35] Run tests for electron on Appveyor. --- appveyor.yml | 5 ++++- scripts/build-appveyor.bat | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8d7ab6c01..a6d9b1b31 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -57,10 +57,13 @@ environment: platform: x64 msvs_toolset: 14 TOOLSET_ARGS: --dist-url=https://s3.amazonaws.com/mapbox/node-cpp11 --toolset=v140 + # electron - nodejs_version: 6 platform: x64 msvs_toolset: 12 - TOOLSET_ARGS: --runtime=electron --target=1.6.0 --dist-url=https://atom.io/download/electron + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.6.3 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron os: Visual Studio 2015 diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 020508927..d6dc5236c 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -7,6 +7,8 @@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET PATH=%CD%;%PATH% SET msvs_version=2013 IF "%msvs_toolset%"=="14" SET msvs_version=2015 +IF NOT "%NODE_RUNTIME%"=="" SET TOOLSET_ARGS="%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%" +IF NOT "%NODE_RUNTIME_VERSION%"=="" SET TOOLSET_ARGS="%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%" ECHO APPVEYOR^: %APPVEYOR% ECHO nodejs_version^: %nodejs_version% @@ -124,7 +126,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http IF %ERRORLEVEL% NEQ 0 GOTO ERROR -FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module --silent') DO SET MODULE=%%i +FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module %TOOLSET_ARGS% --silent') DO SET MODULE=%%i IF %ERRORLEVEL% NEQ 0 GOTO ERROR FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i IF %ERRORLEVEL% NEQ 0 GOTO ERROR @@ -135,6 +137,8 @@ dumpbin /DEPENDENTS "%MODULE%" IF %ERRORLEVEL% NEQ 0 GOTO ERROR +IF "%NODE_RUNTIME%"=="electron" GOTO CHECK_ELECTRON_TEST_ERRORLEVEL + ::skipping check for errorlevel npm test result when using io.js ::@springmeyer: how to proceed? IF NOT "%nodejs_version%"=="1.8.1" IF NOT "%nodejs_version%"=="2.0.0" GOTO CHECK_NPM_TEST_ERRORLEVEL @@ -152,6 +156,17 @@ ECHO ========================================== GOTO NPM_TEST_FINISHED +:CHECK_ELECTRON_TEST_ERRORLEVEL +ECHO installing electron +CALL npm install -g "electron@%NODE_RUNTIME_VERSION%" +ECHO installing electron-mocha +CALL npm install -g electron-mocha +ECHO calling electron-mocha +CALL electron-mocha -R spec --timeout 480000 +IF %ERRORLEVEL% NEQ 0 GOTO ERROR +GOTO NPM_TEST_FINISHED + + :CHECK_NPM_TEST_ERRORLEVEL ECHO calling npm test CALL npm test From c9d7d2570a8d93a6d641ce8c87949a6a27bfa97b Mon Sep 17 00:00:00 2001 From: tsufeki Date: Mon, 20 Mar 2017 20:02:43 +0100 Subject: [PATCH 03/35] Fix .bat variables quoting. --- scripts/build-appveyor.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index d6dc5236c..892cc61bb 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -7,8 +7,8 @@ ECHO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET PATH=%CD%;%PATH% SET msvs_version=2013 IF "%msvs_toolset%"=="14" SET msvs_version=2015 -IF NOT "%NODE_RUNTIME%"=="" SET TOOLSET_ARGS="%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%" -IF NOT "%NODE_RUNTIME_VERSION%"=="" SET TOOLSET_ARGS="%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%" +IF NOT "%NODE_RUNTIME%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%" +IF NOT "%NODE_RUNTIME_VERSION%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%" ECHO APPVEYOR^: %APPVEYOR% ECHO nodejs_version^: %nodejs_version% From e700029812b35b0931ae6f821d93b0b8acaf9fbf Mon Sep 17 00:00:00 2001 From: tsufeki Date: Mon, 20 Mar 2017 21:08:46 +0100 Subject: [PATCH 04/35] Fix .bat variable quoting in for loop. --- scripts/build-appveyor.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 892cc61bb..769392867 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -126,7 +126,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR CALL npm install --build-from-source --msvs_version=%msvs_version% %TOOLSET_ARGS% --loglevel=http IF %ERRORLEVEL% NEQ 0 GOTO ERROR -FOR /F "tokens=*" %%i in ('CALL node_modules\.bin\node-pre-gyp reveal module %TOOLSET_ARGS% --silent') DO SET MODULE=%%i +FOR /F "tokens=*" %%i in ('"CALL node_modules\.bin\node-pre-gyp reveal module %TOOLSET_ARGS% --silent"') DO SET MODULE=%%i IF %ERRORLEVEL% NEQ 0 GOTO ERROR FOR /F "tokens=*" %%i in ('node -e "console.log(process.execPath)"') DO SET NODE_EXE=%%i IF %ERRORLEVEL% NEQ 0 GOTO ERROR From 10c6774806a4bcacfe7c67a766c21d00c10582eb Mon Sep 17 00:00:00 2001 From: tsufeki Date: Tue, 21 Mar 2017 00:06:20 +0100 Subject: [PATCH 05/35] Add electron tests in Appveyor. --- scripts/build-appveyor.bat | 7 ++++ test/support/createdb.js | 65 ++++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 769392867..6991c5f8e 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -161,6 +161,13 @@ ECHO installing electron CALL npm install -g "electron@%NODE_RUNTIME_VERSION%" ECHO installing electron-mocha CALL npm install -g electron-mocha +ECHO preparing tests +( + ECHO var {app} = require('electron'^); + ECHO require('./createdb.js'^)(function (^) { app.quit(^); }^); +) >"test\support\createdb-electron.js" +CALL electron "test/support/createdb-electron.js" +DEL "test\support\createdb-electron.js" ECHO calling electron-mocha CALL electron-mocha -R spec --timeout 480000 IF %ERRORLEVEL% NEQ 0 GOTO ERROR diff --git a/test/support/createdb.js b/test/support/createdb.js index 2cb24c6a6..0c35871da 100755 --- a/test/support/createdb.js +++ b/test/support/createdb.js @@ -1,36 +1,47 @@ #!/usr/bin/env node -var existsSync = require('fs').existsSync || require('path').existsSync; -var path = require('path'); +function createdb(callback) { + var existsSync = require('fs').existsSync || require('path').existsSync; + var path = require('path'); -var sqlite3 = require('../../lib/sqlite3'); + var sqlite3 = require('../../lib/sqlite3'); -var count = 1000000; -var db_path = path.join(__dirname,'big.db'); + var count = 1000000; + var db_path = path.join(__dirname,'big.db'); -function randomString() { - var str = ''; - var chars = 'abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY0123456789 '; - for (var i = Math.random() * 100; i > 0; i--) { - str += chars[Math.floor(Math.random() * chars.length)]; + function randomString() { + var str = ''; + var chars = 'abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY0123456789 '; + for (var i = Math.random() * 100; i > 0; i--) { + str += chars[Math.floor(Math.random() * chars.length)]; + } + return str; + }; + + + if (existsSync(db_path)) { + console.log('okay: database already created (' + db_path + ')'); + if (callback) callback(); + } else { + console.log("Creating test database... This may take several minutes."); + var db = new sqlite3.Database(db_path); + db.serialize(function() { + db.run("CREATE TABLE foo (id INT, txt TEXT)"); + db.run("BEGIN TRANSACTION"); + var stmt = db.prepare("INSERT INTO foo VALUES(?, ?)"); + for (var i = 0; i < count; i++) { + stmt.run(i, randomString()); + } + stmt.finalize(); + db.run("COMMIT TRANSACTION", [], function () { + db.close(callback); + }); + }); } - return str; }; - -if (existsSync(db_path)) { - console.log('okay: database already created (' + db_path + ')'); -} else { - console.log("Creating test database... This may take several minutes."); - var db = new sqlite3.Database(db_path); - db.serialize(function() { - db.run("CREATE TABLE foo (id INT, txt TEXT)"); - db.run("BEGIN TRANSACTION"); - var stmt = db.prepare("INSERT INTO foo VALUES(?, ?)"); - for (var i = 0; i < count; i++) { - stmt.run(i, randomString()); - } - stmt.finalize(); - db.run("COMMIT TRANSACTION"); - }); +if (require.main === module) { + createdb(); } + +module.exports = createdb; From b39b56a9b2c7cb4001a15e6ccce41ad9b7d047c1 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Tue, 21 Mar 2017 00:09:20 +0100 Subject: [PATCH 06/35] Add more electron builds to Appveyor matrix. --- appveyor.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index a6d9b1b31..c9d48f67d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -64,6 +64,24 @@ environment: NODE_RUNTIME: electron NODE_RUNTIME_VERSION: 1.6.3 TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 6 + platform: x86 + msvs_toolset: 12 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.6.3 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 6 + platform: x64 + msvs_toolset: 12 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.3.14 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 6 + platform: x86 + msvs_toolset: 12 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.3.14 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron os: Visual Studio 2015 From 5e26a72868c6ec6520878355800dda9e1b1f3637 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Tue, 21 Mar 2017 23:02:12 +0100 Subject: [PATCH 07/35] Add electron builds to travis. --- .travis.yml | 8 ++++- scripts/build-appveyor.bat | 4 --- scripts/build_against_electron.sh | 49 +++++++++++++++++++++++++++++++ test/support/createdb-electron.js | 7 +++++ 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100755 scripts/build_against_electron.sh create mode 100644 test/support/createdb-electron.js diff --git a/.travis.yml b/.travis.yml index 1bc6f8e26..f1fb284da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -130,7 +130,13 @@ before_script: fi script: -- if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi; +- if [[ "${NODE_VERSION}" ]]; then + if [[ "${ELECTRON_VERSION}" ]]; then + ./scripts/build_against_electron.sh; + else + ./scripts/build_against_node.sh; + fi; + fi - if [[ "${NODE_VERSION}" -eq "4" ]]; then ./node_modules/.bin/eslint lib; fi; # disabled for now: need to port to sudo:false #- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi; diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 6991c5f8e..33fc37fe3 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -162,10 +162,6 @@ CALL npm install -g "electron@%NODE_RUNTIME_VERSION%" ECHO installing electron-mocha CALL npm install -g electron-mocha ECHO preparing tests -( - ECHO var {app} = require('electron'^); - ECHO require('./createdb.js'^)(function (^) { app.quit(^); }^); -) >"test\support\createdb-electron.js" CALL electron "test/support/createdb-electron.js" DEL "test\support\createdb-electron.js" ECHO calling electron-mocha diff --git a/scripts/build_against_electron.sh b/scripts/build_against_electron.sh new file mode 100755 index 000000000..1f364f026 --- /dev/null +++ b/scripts/build_against_electron.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +source ~/.nvm/nvm.sh + +set -e -u + +export DISPLAY=":99.0" +GYP_ARGS="--runtime=electron --target=${ELECTRON_VERSION} --dist-url=https://atom.io/download/electron" +NPM_BIN_DIR="$(npm bin -g 2>/dev/null)" + +function publish() { + if [[ ${PUBLISHABLE:-false} == true ]] && [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then + node-pre-gyp package + node-pre-gyp publish + node-pre-gyp info + fi +} + +function electron_pretest() { + npm install -g electron + npm install -g electron-mocha + sh -e /etc/init.d/xvfb start + sleep 3 +} + +function electron_test() { + "$NPM_BIN_DIR"/electron test/support/createdb-electron.js + "$NPM_BIN_DIR"/electron-mocha -R spec --timeout 480000 +} + +# test installing from source +npm install --build-from-source --clang=1 $GYP_ARGS +electron_pretest +electron_test + +publish +make clean + +# now test building against shared sqlite +export NODE_SQLITE3_JSON1=no +if [[ $(uname -s) == 'Darwin' ]]; then + brew install sqlite + npm install --build-from-source --sqlite=$(brew --prefix) --clang=1 $GYP_ARGS +else + npm install --build-from-source --sqlite=/usr --clang=1 $GYP_ARGS +fi +electron_test +export NODE_SQLITE3_JSON1=yes + diff --git a/test/support/createdb-electron.js b/test/support/createdb-electron.js new file mode 100644 index 000000000..c9b80d642 --- /dev/null +++ b/test/support/createdb-electron.js @@ -0,0 +1,7 @@ + +var {app} = require('electron'); +var createdb = require('./createdb.js'); + +createdb(function () { + app.quit(); +}); From b472d6b80757db2bd09881f640a3c334a6829862 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Tue, 21 Mar 2017 23:11:27 +0100 Subject: [PATCH 08/35] Really add electron builds to travis matrix. --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index f1fb284da..209f09b9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,6 +94,14 @@ matrix: - os: osx compiler: clang env: NODE_VERSION="0.10" # node abi 11 + # electron Linux + - os: linux + compiler: clang + env: NODE_VERSION="6" ELECTRON_VERSION="1.6.2" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] env: global: From 5a79cad5011180a0213028d9081a2cf5f0c97570 Mon Sep 17 00:00:00 2001 From: tsufeki Date: Wed, 22 Mar 2017 20:06:09 +0100 Subject: [PATCH 09/35] Add electron 1.3 build to travis. --- .travis.yml | 7 +++++++ appveyor.yml | 4 ++-- scripts/build_against_electron.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 209f09b9a..5b77f53b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,6 +102,13 @@ matrix: apt: sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] packages: [ 'clang-3.5'] + - os: linux + compiler: clang + env: NODE_VERSION="6" ELECTRON_VERSION="1.3.14" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] env: global: diff --git a/appveyor.yml b/appveyor.yml index c9d48f67d..f463281af 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -62,13 +62,13 @@ environment: platform: x64 msvs_toolset: 12 NODE_RUNTIME: electron - NODE_RUNTIME_VERSION: 1.6.3 + NODE_RUNTIME_VERSION: 1.6.2 TOOLSET_ARGS: --dist-url=https://atom.io/download/electron - nodejs_version: 6 platform: x86 msvs_toolset: 12 NODE_RUNTIME: electron - NODE_RUNTIME_VERSION: 1.6.3 + NODE_RUNTIME_VERSION: 1.6.2 TOOLSET_ARGS: --dist-url=https://atom.io/download/electron - nodejs_version: 6 platform: x64 diff --git a/scripts/build_against_electron.sh b/scripts/build_against_electron.sh index 1f364f026..76feba1bf 100755 --- a/scripts/build_against_electron.sh +++ b/scripts/build_against_electron.sh @@ -17,7 +17,7 @@ function publish() { } function electron_pretest() { - npm install -g electron + npm install -g electron@${ELECTRON_VERSION} npm install -g electron-mocha sh -e /etc/init.d/xvfb start sleep 3 From 5b7424f66abf48f9020ac93e262ffe8e8da6e1e7 Mon Sep 17 00:00:00 2001 From: Kewde Date: Sat, 28 Apr 2018 16:10:35 +0200 Subject: [PATCH 10/35] add latest electron 1.8.4 & 1.7.12 --- appveyor.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 17844446d..1f0c1c6d5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,6 +29,26 @@ environment: - nodejs_version: 9 platform: x86 # electron + - nodejs_version: 8 + platform: x64 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.8.4 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 8 + platform: x86 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.8.4 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 7 + platform: x64 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.7.12 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 7 + platform: x86 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 1.7.12 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron - nodejs_version: 6 platform: x64 msvs_toolset: 12 From 4276e2cd6c7c93b05fa50867bdc388081a62c4f5 Mon Sep 17 00:00:00 2001 From: Kewde Date: Sat, 28 Apr 2018 16:39:29 +0200 Subject: [PATCH 11/35] trigger ci --- scripts/build-appveyor.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index a06117bcd..2487876a4 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -178,7 +178,7 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR :NPM_TEST_FINISHED - +ECHO node-pre-gyp packaging CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS% ::make commit message env var shorter SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% From 3739a15a0be795ae2a2c2268e8b982f6b2482a5c Mon Sep 17 00:00:00 2001 From: Kewde Date: Sat, 28 Apr 2018 18:44:48 +0200 Subject: [PATCH 12/35] add 1.7.12 & 1.8.4 to travis --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.travis.yml b/.travis.yml index 64826d81e..028e18ba1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,6 +91,20 @@ matrix: compiler: clang env: NODE_VERSION="4" # node abi 46 # electron Linux + - os: linux + compiler: clang + env: NODE_VERSION="6" ELECTRON_VERSION="1.8.4" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] + - os: linux + compiler: clang + env: NODE_VERSION="6" ELECTRON_VERSION="1.7.12" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] - os: linux compiler: clang env: NODE_VERSION="6" ELECTRON_VERSION="1.6.2" From f89471699b85f01d8836a779319fd087bb1ca799 Mon Sep 17 00:00:00 2001 From: Kewde Date: Sat, 28 Apr 2018 19:20:55 +0000 Subject: [PATCH 13/35] trigger ci --- scripts/build-appveyor.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index 2487876a4..a5059d2be 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -178,7 +178,6 @@ IF %ERRORLEVEL% NEQ 0 GOTO ERROR :NPM_TEST_FINISHED -ECHO node-pre-gyp packaging CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS% ::make commit message env var shorter SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% From 59e209848a6103a922a800870d0f529f021e05fa Mon Sep 17 00:00:00 2001 From: Kewde Date: Sun, 29 Apr 2018 14:54:24 +0000 Subject: [PATCH 14/35] trigger ci --- scripts/build-appveyor.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index a5059d2be..839943fe7 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -177,7 +177,7 @@ CALL npm test IF %ERRORLEVEL% NEQ 0 GOTO ERROR :NPM_TEST_FINISHED - +ECHO packaging for node-gyp CALL node_modules\.bin\node-pre-gyp package %TOOLSET_ARGS% ::make commit message env var shorter SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% From fa2eddf99a92e4380b62682c084c5f280c4c87a5 Mon Sep 17 00:00:00 2001 From: Kewde Date: Sun, 29 Apr 2018 16:05:30 +0000 Subject: [PATCH 15/35] wait after timeout (credits to original author) --- test/support/createdb-electron.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/support/createdb-electron.js b/test/support/createdb-electron.js index c9b80d642..8a428086a 100644 --- a/test/support/createdb-electron.js +++ b/test/support/createdb-electron.js @@ -3,5 +3,7 @@ var {app} = require('electron'); var createdb = require('./createdb.js'); createdb(function () { - app.quit(); + setTimeout(function () { + app.quit(); + }, 1000); }); From 7c765de89c7dc86da36e57510a1827c092b10c0d Mon Sep 17 00:00:00 2001 From: Kewde Date: Sun, 29 Apr 2018 16:06:52 +0000 Subject: [PATCH 16/35] add artifacts makes individual builds testing easier for now --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 1f0c1c6d5..96ac3bd25 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -82,3 +82,6 @@ install: build: OFF test: OFF deploy: OFF + +artifacts: + - path: '**\electron-*.tar.gz' From e11ca504dddaf8bcc24c0e8ffb52c78e4adfbe1a Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 13:45:43 +0000 Subject: [PATCH 17/35] set timeout 20 seconds --- test/support/createdb-electron.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/createdb-electron.js b/test/support/createdb-electron.js index 8a428086a..eb3ef7ef1 100644 --- a/test/support/createdb-electron.js +++ b/test/support/createdb-electron.js @@ -5,5 +5,5 @@ var createdb = require('./createdb.js'); createdb(function () { setTimeout(function () { app.quit(); - }, 1000); + }, 20000); }); From 906f3c287f1b6359b4824a7ac3f2e8972c1a3626 Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 14:21:32 +0000 Subject: [PATCH 18/35] trigger ci test --- test/support/createdb-electron.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/support/createdb-electron.js b/test/support/createdb-electron.js index eb3ef7ef1..c2cac4183 100644 --- a/test/support/createdb-electron.js +++ b/test/support/createdb-electron.js @@ -7,3 +7,4 @@ createdb(function () { app.quit(); }, 20000); }); + From 7e9f3dd94e2a5ae2d3ba11a202437fe25a9cf97e Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 14:42:11 +0000 Subject: [PATCH 19/35] add verbose --- test/each.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/each.test.js b/test/each.test.js index 02729c64e..c143ec972 100644 --- a/test/each.test.js +++ b/test/each.test.js @@ -1,4 +1,4 @@ -var sqlite3 = require('..'); +var sqlite3 = require('..').verbose(); var assert = require('assert'); describe('each', function() { From 65de9a7aee255ed18948a4198281ad0428738670 Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 14:55:51 +0000 Subject: [PATCH 20/35] add additional timeout to wait --- test/each.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/each.test.js b/test/each.test.js index c143ec972..165644ce8 100644 --- a/test/each.test.js +++ b/test/each.test.js @@ -1,4 +1,4 @@ -var sqlite3 = require('..').verbose(); +var sqlite3 = require('..'); var assert = require('assert'); describe('each', function() { @@ -16,10 +16,10 @@ describe('each', function() { retrieved++; }); - db.wait(function() { + db.wait(setTimeout(function() { assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); done(); - }); + }, 400)); }); it('Statement#each with complete callback', function(done) { From 93d96dadd8dd46867b0912a82adb707f9174085b Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 15:02:19 +0000 Subject: [PATCH 21/35] test: wait for db to unlock first. --- test/each.test.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/each.test.js b/test/each.test.js index 165644ce8..171c15d71 100644 --- a/test/each.test.js +++ b/test/each.test.js @@ -10,16 +10,19 @@ describe('each', function() { it('retrieve 100,000 rows with Statement#each', function(done) { var total = 100000; var retrieved = 0; + + db.wait(function() { + db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { + if (err) throw err; + retrieved++; + }); - db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { - if (err) throw err; - retrieved++; + db.wait(function() { + assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); + done(); + }); }); - db.wait(setTimeout(function() { - assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); - done(); - }, 400)); }); it('Statement#each with complete callback', function(done) { From 14148c8847585d097d74e4814c7b850fea1d1fdb Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 19:11:20 +0000 Subject: [PATCH 22/35] add docs --- test/each.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/each.test.js b/test/each.test.js index 171c15d71..35f58cd45 100644 --- a/test/each.test.js +++ b/test/each.test.js @@ -11,6 +11,8 @@ describe('each', function() { var total = 100000; var retrieved = 0; + // assert fails sometimes if previous test is still running & blocking. + // so wait until it is finished. db.wait(function() { db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { if (err) throw err; From 838105924d7eb21719a0b8436dcc09994d32beaa Mon Sep 17 00:00:00 2001 From: Kewde Date: Mon, 30 Apr 2018 19:45:21 +0000 Subject: [PATCH 23/35] fix test --- test/each.test.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/each.test.js b/test/each.test.js index 35f58cd45..27df32c8c 100644 --- a/test/each.test.js +++ b/test/each.test.js @@ -11,20 +11,16 @@ describe('each', function() { var total = 100000; var retrieved = 0; - // assert fails sometimes if previous test is still running & blocking. - // so wait until it is finished. - db.wait(function() { - db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { - if (err) throw err; - retrieved++; - }); - db.wait(function() { + db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) { + if (err) throw err; + retrieved++; + + if(retrieved === total) { assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows."); done(); - }); + } }); - }); it('Statement#each with complete callback', function(done) { From 534bc4b030e5b12a06039a3230677392fd172b33 Mon Sep 17 00:00:00 2001 From: Kewde Date: Tue, 1 May 2018 03:56:07 +0200 Subject: [PATCH 24/35] travis fix coverage & pip --- .travis.yml | 13 +++++++++---- scripts/build_against_node.sh | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 028e18ba1..4ad7cf186 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,13 @@ matrix: apt: sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] packages: [ 'clang-3.5'] + - os: linux + compiler: clang + env: NODE_VERSION="5" COVERAGE=true PUBLISHABLE=false + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] - os: linux compiler: clang env: NODE_VERSION="4" @@ -69,9 +76,6 @@ matrix: sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] packages: [ 'clang-3.5','libsqlite3-dev'] # OS X - - os: osx - compiler: clang - env: NODE_VERSION="5" COVERAGE=true PUBLISHABLE=false # node abi 47 - os: osx compiler: clang env: NODE_VERSION="9" # node abi 58 @@ -148,7 +152,8 @@ before_script: - export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') - if [[ ${COVERAGE} == true ]]; then if [[ $(uname -s) == 'Linux' ]]; then - PYTHONUSERBASE=$(pwd)/py-local pip install --user cpp-coveralls; + curl https://bootstrap.pypa.io/get-pip.py | python - --user; + pip install --user cpp-coveralls; else PYTHONUSERBASE=$(pwd)/py-local easy_install --user cpp-coveralls; fi; diff --git a/scripts/build_against_node.sh b/scripts/build_against_node.sh index 358c041d4..e018d12f5 100755 --- a/scripts/build_against_node.sh +++ b/scripts/build_against_node.sh @@ -17,7 +17,7 @@ function publish() { if [[ ${COVERAGE} == true ]]; then CXXFLAGS="--coverage" LDFLAGS="--coverage" npm install --build-from-source --clang=1 npm test - ./py-local/bin/cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude docs --exclude build/Release/obj/gen --exclude deps > /dev/null + cpp-coveralls --exclude node_modules --exclude tests --build-root build --gcov-options '\-lp' --exclude docs --exclude build/Release/obj/gen --exclude deps > /dev/null else echo "building binaries for publishing" CFLAGS="${CFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" CXXFLAGS="${CXXFLAGS:-} -include $(pwd)/src/gcc-preinclude.h" V=1 npm install --build-from-source --clang=1 From 62624f02f4a9a551246f297e13cbb1eed28520a9 Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 16:17:05 +0000 Subject: [PATCH 25/35] add electron 2.0.1 --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4ad7cf186..c7c063af3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,6 +95,13 @@ matrix: compiler: clang env: NODE_VERSION="4" # node abi 46 # electron Linux + - os: linux + compiler: clang + env: NODE_VERSION="6" ELECTRON_VERSION="2.0.1" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] + packages: [ 'clang-3.5'] - os: linux compiler: clang env: NODE_VERSION="6" ELECTRON_VERSION="1.8.4" From 6f64c2bd1a9c457a9b726a6fe6a825e5c0763548 Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 16:18:42 +0000 Subject: [PATCH 26/35] add electron 2.0.1 windows --- appveyor.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 96ac3bd25..03a8bdc7d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,6 +29,16 @@ environment: - nodejs_version: 9 platform: x86 # electron + - nodejs_version: 8 + platform: x64 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 2.0.1 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron + - nodejs_version: 8 + platform: x86 + NODE_RUNTIME: electron + NODE_RUNTIME_VERSION: 2.0.1 + TOOLSET_ARGS: --dist-url=https://atom.io/download/electron - nodejs_version: 8 platform: x64 NODE_RUNTIME: electron From e2bfb288f2ab370b4bad4695ca60ecea6274f4b8 Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 16:38:57 +0000 Subject: [PATCH 27/35] update libc6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7c063af3..9f7aca3e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,7 +101,7 @@ matrix: addons: apt: sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ] - packages: [ 'clang-3.5'] + packages: [ 'clang-3.5', 'libc6'] - os: linux compiler: clang env: NODE_VERSION="6" ELECTRON_VERSION="1.8.4" From f46fef5810bef4af67aedfe8dc23ea6adba85e15 Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 18:26:36 +0000 Subject: [PATCH 28/35] switch to trusty instead of precise --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f7aca3e8..c59ac87ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: false language: generic -dist: precise +dist: trusty git: depth: 10 From c1a2122851124e9d7969ad61b0522c9994cdf3b4 Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 18:54:18 +0000 Subject: [PATCH 29/35] Quick upload script (need binary for v2.0) --- scripts/build_against_electron.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/build_against_electron.sh b/scripts/build_against_electron.sh index c0f65c953..a4852078a 100755 --- a/scripts/build_against_electron.sh +++ b/scripts/build_against_electron.sh @@ -36,6 +36,19 @@ electron_test publish make clean +# TODO: remove me -start +cd ./lib/binding/ +for dir in `ls | grep "electron-v2.0"`; do + echo "Zipping & Uploading $dir" + file=$(echo "${dir}.zip") + zip -R $file $dir + url="$(curl -H "Max-Days: 1" -s --upload-file $file https://transfer.sh/$file)\n" + echo "Uploaded file= ${url}" +done +cd ../../ +# TODO: remove me -end + + # now test building against shared sqlite export NODE_SQLITE3_JSON1=no if [[ $(uname -s) == 'Darwin' ]]; then From cee7f3b51b76b7de494d4bb8f5973229b4c932fa Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 19:00:39 +0000 Subject: [PATCH 30/35] move before make clean lol --- scripts/build_against_electron.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build_against_electron.sh b/scripts/build_against_electron.sh index a4852078a..f7bb7fdc5 100755 --- a/scripts/build_against_electron.sh +++ b/scripts/build_against_electron.sh @@ -30,11 +30,6 @@ function electron_test() { # test installing from source npm install --build-from-source --clang=1 $GYP_ARGS -electron_pretest -electron_test - -publish -make clean # TODO: remove me -start cd ./lib/binding/ @@ -47,7 +42,12 @@ for dir in `ls | grep "electron-v2.0"`; do done cd ../../ # TODO: remove me -end - + +electron_pretest +electron_test + +publish +make clean # now test building against shared sqlite export NODE_SQLITE3_JSON1=no From f5f9303bde705572c8fa1d34ac3fd05731e43e3f Mon Sep 17 00:00:00 2001 From: Kewde Date: Wed, 23 May 2018 19:10:47 +0000 Subject: [PATCH 31/35] zip recursive --- scripts/build_against_electron.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_against_electron.sh b/scripts/build_against_electron.sh index f7bb7fdc5..2eaaea473 100755 --- a/scripts/build_against_electron.sh +++ b/scripts/build_against_electron.sh @@ -36,7 +36,7 @@ cd ./lib/binding/ for dir in `ls | grep "electron-v2.0"`; do echo "Zipping & Uploading $dir" file=$(echo "${dir}.zip") - zip -R $file $dir + zip -r $file $dir url="$(curl -H "Max-Days: 1" -s --upload-file $file https://transfer.sh/$file)\n" echo "Uploaded file= ${url}" done From e0d0b24d9744abc4fb52fc973bde5a7f5ad93062 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 23 Jun 2018 07:49:42 -0700 Subject: [PATCH 32/35] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 142a766e7..60149d22c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: false language: generic -dist: trusty +dist: precise git: depth: 10 From bf585137a6e3fad72d85a59bc80bbfe048bd3148 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 23 Jun 2018 07:50:32 -0700 Subject: [PATCH 33/35] Remove artifacts for now (can add back if absolutely needed0 --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fbfed1a8f..8740b5bfc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -94,6 +94,3 @@ install: build: OFF test: OFF deploy: OFF - -artifacts: - - path: '**\electron-*.tar.gz' From 852b7fd0478815d07bfb65d3254047d4af99d550 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 23 Jun 2018 07:51:07 -0700 Subject: [PATCH 34/35] fix accidentally removed msvs_version=2013 support (for node v4) --- scripts/build-appveyor.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-appveyor.bat b/scripts/build-appveyor.bat index faccce745..362cf5bb0 100644 --- a/scripts/build-appveyor.bat +++ b/scripts/build-appveyor.bat @@ -8,6 +8,7 @@ IF /I "%msvs_toolset%"=="" ECHO msvs_toolset unset, defaulting to 14 && SET msvs IF /I "%msvs_version%"=="" ECHO msvs_version unset, defaulting to 2015 && SET msvs_version=2015 SET PATH=%CD%;%PATH% +IF "%msvs_toolset%"=="12" SET msvs_version=2013 IF NOT "%NODE_RUNTIME%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --runtime=%NODE_RUNTIME%" IF NOT "%NODE_RUNTIME_VERSION%"=="" SET "TOOLSET_ARGS=%TOOLSET_ARGS% --target=%NODE_RUNTIME_VERSION%" From 599c7f80f01a86d973275234b58de05311f944e8 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 23 Jun 2018 07:59:28 -0700 Subject: [PATCH 35/35] trusty upgrade for electron v2 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 60149d22c..0fd46c415 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,6 +111,7 @@ matrix: - os: linux compiler: clang env: NODE_VERSION="6" ELECTRON_VERSION="2.0.1" + dist: trusty # needed for libc6 / 'version `GLIBC_2.17` not found' error on precise addons: apt: sources: [ 'ubuntu-toolchain-r-test','llvm-toolchain-precise-3.5', 'gcc-multilib', 'g++-multilib', 'libsqlite3-dev:i386' ]