Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
~r"/src/fast_pbkdf2/",
~r"/src/jason",
~r"/src/hackney",
~r"/src/httpotion",
~r"/src/file_system",
~r"/src/credo",
~r"/src/idna",
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ test/javascript/junit.xml
/_build/
/src/bunt
/src/credo/
/src/httpotion/
/src/jason/
/src/junit_formatter/

Expand Down
9 changes: 3 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule CouchDBTest.Mixfile do
end

# Run "mix help compile.app" to learn about applications.
def application, do: [applications: [:logger, :httpotion]]
def application, do: [applications: [:logger]]

# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["test/elixir/lib", "test/elixir/test/support"]
Expand All @@ -84,9 +84,7 @@ defmodule CouchDBTest.Mixfile do
defp deps() do
deps1 = [
{:junit_formatter, "~> 3.4", only: [:dev, :test, :integration]},
{:httpotion, ">= 3.2.0", only: [:dev, :test, :integration], runtime: false},
{:excoveralls, "~> 0.18.5", only: :test},
{:ibrowse, path: path("ibrowse"), override: true},
{:credo, "== 1.7.19", only: [:dev, :test, :integration], runtime: false}
]

Expand All @@ -95,14 +93,14 @@ defmodule CouchDBTest.Mixfile do

deps_list = deps1 ++ deps2

[:config, :couch, :fabric]
[:config, :couch, :fabric, :gun, :cowlib]
|> Enum.map(&path("#{&1}/ebin"))
|> Enum.map(&String.to_charlist/1)
|> Enum.each(&:code.add_patha/1)

# Some deps may be missing during source check
# Besides we don't want to spend time checking them anyway
List.foldl([:ibrowse | extra_deps], deps_list, fn dep, acc ->
List.foldl(extra_deps, deps_list, fn dep, acc ->
if File.dir?(acc[dep][:path]) do
acc
else
Expand Down Expand Up @@ -133,7 +131,6 @@ defmodule CouchDBTest.Mixfile do
"credo",
"excoveralls",
"hackney",
"httpotion",
"ibrowse",
"idna",
"jason",
Expand Down
5 changes: 3 additions & 2 deletions src/chttpd/test/eunit/chttpd_db_attachment_size_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,9 @@ req(Method, Url, Headers, Body) ->
{ok, Code, _, Res} = test_request:request(Method, Url, Headers1, Body),
{Code, json_decode(Res)}.

% Data streaming generator for ibrowse client. ibrowse will repeatedly call the
% function with State and it should return {ok, Data, NewState} or eof at end.
% Data streaming generator for the test http client, which repeatedly calls
% the function with State; it should return {ok, Data, NewState} or eof at
% the end.
data_stream_fun(Size) ->
Fun = fun
(0) -> eof;
Expand Down
13 changes: 4 additions & 9 deletions src/chttpd/test/eunit/chttpd_dbs_info_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-define(CONTENT_JSON, {"Content-Type", "application/json"}).

start() ->
Ctx = test_util:start_couch([inets, chttpd]),
Ctx = test_util:start_couch([chttpd]),
DbDir = config:get("couchdb", "database_dir"),
Suffix = ?b2l(couch_uuids:random()),
test_util:with_couch_server_restart(fun() ->
Expand Down Expand Up @@ -183,17 +183,12 @@ should_return_nothing_when_db_not_exist_for_get_dbs_info(_) ->

should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info(_) ->
mock_timeout(),
Auth = base64:encode_to_string(?USER ++ ":" ++ ?PASS),
Headers = [{"Authorization", "Basic " ++ Auth}],
Request = {dbs_info_url("buffer_response=true"), Headers},
Url = dbs_info_url("buffer_response=true"),
{Props} =
test_util:wait(
fun() ->
% Use httpc to avoid ibrowse returning {error,
% retry_later} in some cases, causing test_request to
% sleep and retry, resulting in timeout failures.
case httpc:request(get, Request, [], []) of
{ok, {{_, Code, _}, _, Body}} ->
case test_request:get(Url, [?CONTENT_JSON, ?AUTH]) of
{ok, Code, _, Body} ->
?assertEqual(500, Code),
jiffy:decode(Body);
_ ->
Expand Down
1 change: 1 addition & 0 deletions src/couch/src/couch.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
os_mon,

% Upstream deps
gun,
ibrowse,
mochiweb,

Expand Down
Loading