diff options
author | Joan Touzet <wohali@users.noreply.github.com> | 2020-02-08 00:30:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-08 00:30:31 -0500 |
commit | 24e2c8bf61a4e82504ea6e6ba2caa779980b9597 (patch) | |
tree | 6024f2f13d228ef17ecef313a412dd8715096a40 | |
parent | f58ebc1e75d281bce851b92e36e95b42ca229627 (diff) | |
download | couchdb-3.0.0-RC1.tar.gz |
Fix Windows build (#2534)3.0.0-RC1
* Allows `configure.ps1` to correctly pull and build `rebar` on Windows
* Removes the static declarations in `rebar.config.script` on
specific, pre-determined paths to various includes/libraries
necessary for NIFs and external binaries (expectation is these are
passed in env vars INCLUDE, LIB and LIBPATH)
* fixes the SM60 `couchjs` build by telling `windows.h` not to
redefine min and max as macros through a `#define`
* fixes the `make eunit` target on Windows
* Adds the missing `EXE_LINK_CXX_TEMPLATE` that our rebar doesn't have,
but `enc` has today, which is also causing a failed `couchjs` (C++)
build on Windows
* Causes `make python-black` to correctly cause failure in `make check`
if it finds problems
* fixes Mango tests on Python 3.8 by bumping the hypothesis dependency
* fixes one Elixir test on Windows (incorrect calculation of `now(:ms)`
due to Erlang clock precision difference)
* a little bit of python black cleanup (mango tests)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | Makefile.win | 42 | ||||
-rw-r--r-- | configure.ps1 | 15 | ||||
-rw-r--r-- | mix.lock | 28 | ||||
-rw-r--r-- | src/couch/priv/couch_js/60/main.cpp | 1 | ||||
-rw-r--r-- | src/couch/rebar.config.script | 23 | ||||
-rw-r--r-- | src/mango/requirements.txt | 2 | ||||
-rw-r--r-- | src/mango/test/05-index-selection-test.py | 8 | ||||
-rw-r--r-- | src/mango/test/12-use-correct-index-test.py | 2 | ||||
-rw-r--r-- | test/elixir/lib/couch/db_test.ex | 7 |
11 files changed, 80 insertions, 54 deletions
diff --git a/.gitignore b/.gitignore index 78eccc10f..60e6d145a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.so *.pyc *.swp +*.pdb *~ .venv .DS_Store @@ -146,14 +146,11 @@ fauxton: share/www .PHONY: check # target: check - Test everything -check: all - @$(MAKE) python-black +check: all python-black @$(MAKE) eunit @$(MAKE) javascript @$(MAKE) mango-test @$(MAKE) elixir -# @$(MAKE) build-test - ifdef apps subdirs = $(apps) diff --git a/Makefile.win b/Makefile.win index ad7ad243c..30ebe0ee3 100644 --- a/Makefile.win +++ b/Makefile.win @@ -17,7 +17,9 @@ include version.mk SHELL=cmd.exe -REBAR?=$(shell where rebar.cmd) +REBAR=bin\rebar.cmd +MAKE=make -f Makefile.win +# REBAR?=$(shell where rebar.cmd) # Handle the following scenarios: # 1. When building from a tarball, use version.mk. @@ -87,7 +89,7 @@ EXUNIT_OPTS=$(subst $(comma),$(space),$(tests)) #ignore javascript tests ignore_js_suites= -TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local'" +TEST_OPTS=-c startup_jitter=0 -c default_security=admin_local ################################################################################ # Main commands @@ -131,13 +133,11 @@ fauxton: share\www .PHONY: check # target: check - Test everything -check: all - @$(MAKE) -f Makefile.win python-black - @$(MAKE) -f Makefile.win eunit - @$(MAKE) -f Makefile.win javascript - @$(MAKE) -f Makefile.win mango-test - @$(MAKE) -f Makefile.win elixir -# @$(MAKE) -f Makefile.win build-test +check: all python-black + @$(MAKE) eunit + @$(MAKE) javascript + @$(MAKE) mango-test + @$(MAKE) elixir ifdef apps subdirs = $(apps) @@ -153,7 +153,7 @@ eunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell echo %cd%)/bin/couchjs $ eunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 eunit: couch @set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) setup_eunit 2> nul - @FOR /F "tokens=*" %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) && set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) && $(REBAR) -r eunit $(EUNIT_OPTS) apps=%dir + @cmd /c "FOR %d IN ($(subdirs)) DO set COUCHDB_VERSION=$(COUCHDB_VERSION) & set COUCHDB_GIT_SHA=$(COUCHDB_GIT_SHA) & $(REBAR) -r eunit $(EUNIT_OPTS) apps=%d" .PHONY: exunit # target: exunit - Run ExUnit tests @@ -166,12 +166,12 @@ exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo @mix test --cover --trace $(EXUNIT_OPTS) setup-eunit: export BUILDDIR = $(shell pwd) -setup-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") +setup-eunit: export ERL_AFLAGS = "-config $(shell echo %cd%)/rel/files/eunit.config") setup-eunit: @$(REBAR) setup_eunit 2> nul just-eunit: export BUILDDIR = $(shell pwd) -just-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") +just-eunit: export ERL_AFLAGS = "-config $(shell echo %cd%)/rel/files/eunit.config") just-eunit: @$(REBAR) -r eunit $(EUNIT_OPTS) @@ -182,7 +182,7 @@ just-eunit: # Python code formatter - only runs if we're on Python 3.6 or greater python-black: .venv/bin/black @python.exe -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \ - echo "Python formatter not supported on Python < 3.6; check results on a newer platform" + echo 'Python formatter not supported on Python < 3.6; check results on a newer platform' @python.exe -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ .venv\Scripts\black.exe --check \ --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/rebar/pr2relnotes.py|src/fauxton" \ @@ -190,7 +190,7 @@ python-black: .venv/bin/black python-black-update: .venv/bin/black @python.exe -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \ - echo "Python formatter not supported on Python < 3.6; check results on a newer platform" + echo 'Python formatter not supported on Python < 3.6; check results on a newer platform' @python.exe -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \ .venv\Scripts\black.exe \ --exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/rebar/pr2relnotes.py|src/fauxton" \ @@ -200,7 +200,7 @@ python-black-update: .venv/bin/black elixir: export MIX_ENV=integration elixir: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 elixir: elixir-init elixir-check-formatted elixir-credo devclean - @dev\run "$(TEST_OPTS)" -a adm:pass -n 1 --enable-erlang-views --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)' + @dev\run $(TEST_OPTS) -a adm:pass -n 1 --enable-erlang-views --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)' .PHONY: elixir-init elixir-init: MIX_ENV=test @@ -245,8 +245,8 @@ else endif @python dev\run -n 1 -q --with-admin-party-please \ --enable-erlang-views \ - "$(TEST_OPTS)" \ - 'test/javascript/run --suites "$(suites)" \ + $(TEST_OPTS) \ + 'python test\javascript\run --suites "$(suites)" \ --ignore "$(ignore_js_suites)"' @@ -313,14 +313,14 @@ dist: all derived @copy src\docs\build\man\apachecouchdb.1 apache-couchdb-$(COUCHDB_VERSION)\share\docs\man @tar czf apache-couchdb-$(COUCHDB_VERSION).tar.gz apache-couchdb-$(COUCHDB_VERSION) - @echo "Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz" + @echo 'Done: apache-couchdb-$(COUCHDB_VERSION).tar.gz' .PHONY: release # target: release - Create an Erlang release including CouchDB! -include install.mk release: all - @echo Installing CouchDB into rel\couchdb\ ... + @echo 'Installing CouchDB into rel\couchdb\ ...' -@rmdir /s/q rel\couchdb @$(REBAR) generate @copy src\couch\priv\couchjs.exe rel\couchdb\bin @@ -423,7 +423,7 @@ config.erl: src\docs\build: - @echo Building docs... + @echo 'Building docs...' ifeq ($(with_docs), 1) @cd src\docs && make.bat html && make.bat man endif @@ -431,7 +431,7 @@ endif share\www: ifeq ($(with_fauxton), 1) - @echo "Building Fauxton" + @echo 'Building Fauxton' @cd src\fauxton && npm install --production && .\node_modules\.bin\grunt couchdb endif diff --git a/configure.ps1 b/configure.ps1 index 9888a9fe0..c74fbcf41 100644 --- a/configure.ps1 +++ b/configure.ps1 @@ -190,6 +190,21 @@ $ConfigERL = @" "@ $ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii +# check for rebar; if not found, build it and add it to our path +if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null) +{ + Write-Verbose "==> rebar.cmd not found; bootstrapping..." + if (-Not (Test-Path "src\rebar")) + { + git clone --depth 1 https://github.com/apache/couchdb-rebar.git $rootdir\src\rebar + } + cmd /c "cd src\rebar && $rootdir\src\rebar\bootstrap.bat" + cp $rootdir\src\rebar\rebar $rootdir\bin\rebar + cp $rootdir\src\rebar\rebar.cmd $rootdir\bin\rebar.cmd + make -C $rootdir\src\rebar clean + $env:Path += ";$rootdir\bin" +} + # only update dependencies, when we are not in a release tarball if ( (Test-Path .git -PathType Container) -and (-not $SkipDeps) ) { Write-Verbose "==> updating dependencies" @@ -1,18 +1,18 @@ %{ - "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, - "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, - "credo": {:hex, :credo, "1.0.5", "fdea745579f8845315fe6a3b43e2f9f8866839cfbc8562bb72778e9fdaa94214", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, - "excoveralls": {:hex, :excoveralls, "0.12.1", "a553c59f6850d0aff3770e4729515762ba7c8e41eedde03208182a8dc9d0ce07", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, - "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, - "httpotion": {:hex, :httpotion, "3.1.3", "fdaf1e16b9318dcb722de57e75ac368c93d4c6e3c9125f93e960f953a750fb77", [:mix], [{:ibrowse, "== 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm"}, + "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, + "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"}, + "credo": {:hex, :credo, "1.0.5", "fdea745579f8845315fe6a3b43e2f9f8866839cfbc8562bb72778e9fdaa94214", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "16105fac37c5c4b3f6e1f70ba0784511fec4275cd8bb979386e3c739cf4e6455"}, + "excoveralls": {:hex, :excoveralls, "0.12.1", "a553c59f6850d0aff3770e4729515762ba7c8e41eedde03208182a8dc9d0ce07", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "5c1f717066a299b1b732249e736c5da96bb4120d1e55dc2e6f442d251e18a812"}, + "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"}, + "httpotion": {:hex, :httpotion, "3.1.3", "fdaf1e16b9318dcb722de57e75ac368c93d4c6e3c9125f93e960f953a750fb77", [:mix], [{:ibrowse, "== 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm", "e420172ef697a0f1f4dc40f89a319d5a3aad90ec51fa424f08c115f04192ae43"}, "ibrowse": {:hex, :ibrowse, "4.4.0", "2d923325efe0d2cb09b9c6a047b2835a5eda69d8a47ed6ff8bc03628b764e991", [:rebar3], [], "hexpm"}, - "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, - "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, + "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"}, + "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fdf843bca858203ae1de16da2ee206f53416bbda5dc8c9e78f43243de4bc3afe"}, "jiffy": {:hex, :jiffy, "0.15.2", "de266c390111fd4ea28b9302f0bc3d7472468f3b8e0aceabfbefa26d08cd73b7", [:rebar3], [], "hexpm"}, - "junit_formatter": {:hex, :junit_formatter, "3.0.0", "13950d944dbd295da7d8cc4798b8faee808a8bb9b637c88069954eac078ac9da", [:mix], [], "hexpm"}, - "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"}, - "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm"}, - "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm"}, - "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"}, + "junit_formatter": {:hex, :junit_formatter, "3.0.0", "13950d944dbd295da7d8cc4798b8faee808a8bb9b637c88069954eac078ac9da", [:mix], [], "hexpm", "d77b7b9a1601185b18dfe7682b27c46d5d12721f12fdc75180a6fc573b4e64b1"}, + "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, + "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, + "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm", "13104d7897e38ed7f044c4de953a6c28597d1c952075eb2e328bc6d6f2bfc496"}, + "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm", "1d1848c40487cdb0b30e8ed975e34e025860c02e419cb615d255849f3427439d"}, } diff --git a/src/couch/priv/couch_js/60/main.cpp b/src/couch/priv/couch_js/60/main.cpp index e78dbb46d..b6157ed85 100644 --- a/src/couch/priv/couch_js/60/main.cpp +++ b/src/couch/priv/couch_js/60/main.cpp @@ -15,6 +15,7 @@ #include <string.h> #ifdef XP_WIN +#define NOMINMAX #include <windows.h> #else #include <unistd.h> diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script index c0889ce75..91e24d99e 100644 --- a/src/couch/rebar.config.script +++ b/src/couch/rebar.config.script @@ -100,8 +100,8 @@ end, {JS_CFLAGS, JS_LDFLAGS} = case os:type() of {win32, _} when SMVsn == "1.8.5" -> { - "/DXP_WIN /IC:\\relax\\js-1.8.5\\js\\src", - "/LIBPATH:C:\\relax\\js-1.8.5\\js\\src mozjs185-1.0.lib" + "/DXP_WIN", + "mozjs185-1.0.lib" }; {unix, _} when SMVsn == "1.8.5" -> { @@ -110,8 +110,8 @@ end, }; {win32, _} when SMVsn == "60" -> { - "/DXP_WIN /IC:\\relax\\js-60\\js\\src", - "/LIBPATH:C:\\relax\\js-60\\js\\src mozjs-60.lib" + "/DXP_WIN", + "mozjs-60.lib" }; {unix, darwin} when SMVsn == "60" -> { @@ -130,8 +130,8 @@ end. case os:type() of {win32, _} -> { - "/DHAVE_CURL /IC:\\relax\\curl\\include", - "/LIBPATH:C:\\Relax\\curl\\lib\\release-ssl libcurl_imp.lib" + "/DHAVE_CURL", + "/DHAVE_CURL libcurl.lib" }; {unix, freebsd} -> { @@ -174,8 +174,8 @@ IcuDarwinEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/opt/icu4c/include"}, {"LDFLAGS", "-L/usr/local/opt/icu4c/lib"}], IcuBsdEnv = [{"CFLAGS", "-DXP_UNIX -I/usr/local/include"}, {"LDFLAGS", "-L/usr/local/lib"}], -IcuWinEnv = [{"CFLAGS", "/DXP_WIN /IC:\\relax\\icu\\include"}, - {"LDFLAGS", "/LIBPATH:C:\\relax\\icu\\lib64 icuin.lib icudt.lib icuuc.lib"}], +IcuWinEnv = [{"CFLAGS", "$DRV_CFLAGS /DXP_WIN"}, + {"LDFLAGS", "icuin.lib icudt.lib icuuc.lib"}], ComparePath = "priv/couch_ejson_compare.so", CompareSrc = ["priv/couch_ejson_compare/*.c"], @@ -199,6 +199,12 @@ SpawnSpec = [ {"priv/couchspawnkillable", ["priv/spawnkillable/*.c"]} ], +%% hack required until switch to enc/rebar3 +PortEnvOverrides = [ + {"win32", "EXE_LINK_CXX_TEMPLATE", + "$LINKER $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS /OUT:$PORT_OUT_FILE"} +], + PortSpecs = case os:type() of {win32, _} -> BaseSpecs ++ SpawnSpec; @@ -218,6 +224,7 @@ AddConfig = [ {d, 'COUCHDB_GIT_SHA', GitSha}, {i, "../"} ] ++ MD5Config ++ ProperConfig}, + {port_env, PortEnvOverrides}, {eunit_compile_opts, PlatformDefines} ]. diff --git a/src/mango/requirements.txt b/src/mango/requirements.txt index a56acebd0..364a9363a 100644 --- a/src/mango/requirements.txt +++ b/src/mango/requirements.txt @@ -1,4 +1,4 @@ nose==1.3.7 requests==2.20.1 -hypothesis==3.79.0 +hypothesis==5.5.1 diff --git a/src/mango/test/05-index-selection-test.py b/src/mango/test/05-index-selection-test.py index 2bc5a88f0..cb4d32986 100644 --- a/src/mango/test/05-index-selection-test.py +++ b/src/mango/test/05-index-selection-test.py @@ -84,7 +84,7 @@ class IndexSelectionTests: ddocid = "_design/age" r = self.db.find({}, use_index=ddocid, return_raw=True) self.assertEqual( - r["warning"].split('\n')[0].lower(), + r["warning"].split("\n")[0].lower(), "{0} was not used because it does not contain a valid index for this query.".format( ddocid ), @@ -107,7 +107,7 @@ class IndexSelectionTests: selector = {"company": "Pharmex"} r = self.db.find(selector, use_index=ddocid, return_raw=True) self.assertEqual( - r["warning"].split('\n')[0].lower(), + r["warning"].split("\n")[0].lower(), "{0} was not used because it does not contain a valid index for this query.".format( ddocid ), @@ -124,7 +124,7 @@ class IndexSelectionTests: resp = self.db.find(selector, use_index=[ddocid, name], return_raw=True) self.assertEqual( - resp["warning"].split('\n')[0].lower(), + resp["warning"].split("\n")[0].lower(), "{0}, {1} was not used because it is not a valid index for this query.".format( ddocid, name ), @@ -162,7 +162,7 @@ class IndexSelectionTests: selector, sort=["foo", "bar"], use_index=ddocid_invalid, return_raw=True ) self.assertEqual( - resp["warning"].split('\n')[0].lower(), + resp["warning"].split("\n")[0].lower(), "{0} was not used because it does not contain a valid index for this query.".format( ddocid_invalid ), diff --git a/src/mango/test/12-use-correct-index-test.py b/src/mango/test/12-use-correct-index-test.py index b6fe434f8..c21ad6c5e 100644 --- a/src/mango/test/12-use-correct-index-test.py +++ b/src/mango/test/12-use-correct-index-test.py @@ -93,7 +93,7 @@ class ChooseCorrectIndexForDocs(mango.DbPerClass): self.assertEqual(explain_resp["index"]["type"], "special") resp = self.db.find(selector, return_raw=True) self.assertEqual( - resp["warning"].split('\n')[0].lower(), + resp["warning"].split("\n")[0].lower(), "no matching index found, create an index to optimize query time.", ) diff --git a/test/elixir/lib/couch/db_test.ex b/test/elixir/lib/couch/db_test.ex index b138937f2..0a091c667 100644 --- a/test/elixir/lib/couch/db_test.ex +++ b/test/elixir/lib/couch/db_test.ex @@ -346,7 +346,12 @@ defmodule Couch.DBTest do end defp now(:ms) do - div(:erlang.system_time(), 1_000_000) + case elem(:os.type, 0) do + :win32 -> + div(:erlang.system_time(), 1_000) + _ -> + div(:erlang.system_time(), 1_000_000) + end end @spec rev(map(), map()) :: map() |