diff options
author | Nick Vatamaniuc <vatamane@gmail.com> | 2022-12-20 23:49:07 -0500 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2022-12-21 08:49:02 +0100 |
commit | 088cb3ffece9d523bd35ca18a97c797680008a61 (patch) | |
tree | 2008276a1430de928fec34003c281aae97c2fe80 | |
parent | e6b1be70050fe887f7438a43dba4833b0fc8022e (diff) | |
download | couchdb-088cb3ffece9d523bd35ca18a97c797680008a61.tar.gz |
Move elixir source checks to a separate step
This is to help unblock 3.3 windows build so make check doesn't choke on
re-formatting elixir files for Windows.
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | build-aux/Jenkinsfile.pr | 1 | ||||
-rw-r--r-- | mix.exs | 12 |
3 files changed, 21 insertions, 14 deletions
@@ -185,7 +185,7 @@ exunit: export ERL_LIBS = $(shell pwd)/src exunit: export ERL_AFLAGS = -config $(shell pwd)/rel/files/eunit.config exunit: export COUCHDB_QUERY_SERVER_JAVASCRIPT = $(shell pwd)/bin/couchjs $(shell pwd)/share/server/main.js exunit: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 -exunit: couch elixir-init setup-eunit elixir-check-formatted elixir-credo +exunit: couch elixir-init setup-eunit @mix test --trace $(EXUNIT_OPTS) setup-eunit: export BUILDDIR = $(shell pwd) @@ -235,27 +235,27 @@ python-black-update: .venv/bin/black .PHONY: elixir elixir: export MIX_ENV=integration elixir: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 -elixir: elixir-init elixir-check-formatted elixir-credo devclean +elixir: elixir-init devclean @dev/run "$(TEST_OPTS)" -a adm:pass -n 1 \ --enable-erlang-views \ --locald-config test/elixir/test/config/test-config.ini \ --no-eval 'mix test --trace --exclude without_quorum_test --exclude with_quorum_test $(EXUNIT_OPTS)' .PHONY: elixir-init -elixir-init: MIX_ENV=test +elixir-init: MIX_ENV=integration elixir-init: config.erl @mix local.rebar --force rebar ./bin/rebar && mix local.rebar --force rebar3 ./bin/rebar3 && mix local.hex --force && mix deps.get .PHONY: elixir-cluster-without-quorum elixir-cluster-without-quorum: export MIX_ENV=integration -elixir-cluster-without-quorum: elixir-init elixir-check-formatted elixir-credo devclean +elixir-cluster-without-quorum: elixir-init devclean @dev/run -n 3 -q -a adm:pass \ --degrade-cluster 2 \ --no-eval 'mix test --trace --only without_quorum_test $(EXUNIT_OPTS)' .PHONY: elixir-cluster-with-quorum elixir-cluster-with-quorum: export MIX_ENV=integration -elixir-cluster-with-quorum: elixir-init elixir-check-formatted elixir-credo devclean +elixir-cluster-with-quorum: elixir-init devclean @dev/run -n 3 -q -a adm:pass \ --degrade-cluster 1 \ --no-eval 'mix test --trace --only with_quorum_test $(EXUNIT_OPTS)' @@ -263,7 +263,7 @@ elixir-cluster-with-quorum: elixir-init elixir-check-formatted elixir-credo devc .PHONY: elixir-suite elixir-suite: export MIX_ENV=integration elixir-suite: export COUCHDB_TEST_ADMIN_PARTY_OVERRIDE=1 -elixir-suite: elixir-init elixir-check-formatted elixir-credo devclean +elixir-suite: elixir-init devclean @dev/run -n 1 -q -a adm:pass \ --enable-erlang-views \ --no-join \ @@ -271,14 +271,10 @@ elixir-suite: elixir-init elixir-check-formatted elixir-credo devclean --erlang-config rel/files/eunit.config \ --no-eval 'mix test --trace --include test/elixir/test/config/suite.elixir --exclude test/elixir/test/config/skip.elixir' -.PHONY: elixir-check-formatted -elixir-check-formatted: elixir-init +.PHONY: elixir-source-checks +elixir-source-checks: export MIX_ENV=integration +elixir-source-checks: elixir-init @mix format --check-formatted - -# Credo is a static code analysis tool for Elixir. -# We use it in our tests -.PHONY: elixir-credo -elixir-credo: elixir-init @mix credo .PHONY: build-report diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr index 70b45b586..ba4107af2 100644 --- a/build-aux/Jenkinsfile.pr +++ b/build-aux/Jenkinsfile.pr @@ -185,6 +185,7 @@ pipeline { rm -rf apache-couchdb-* ./configure --skip-deps make erlfmt-check + make elixir-source-checks make python-black ''' } @@ -84,7 +84,7 @@ defmodule CouchDBTest.Mixfile do # Run "mix help deps" to learn about dependencies. defp deps() do - [ + deps_list = [ {:junit_formatter, "~> 3.0", only: [:dev, :test, :integration]}, {:httpotion, ">= 3.1.3", only: [:dev, :test, :integration], runtime: false}, {:excoveralls, "~> 0.12", only: :test}, @@ -94,6 +94,16 @@ defmodule CouchDBTest.Mixfile do {:ibrowse, path: path("ibrowse"), override: true}, {:credo, "~> 1.6.4", only: [:dev, :test, :integration], runtime: false} ] + + # Some deps may be missing during source check + # Besides we don't want to spend time checking them anyway + List.foldl([:b64url, :jiffy, :jwtf, :ibrowse], deps_list, fn dep, acc -> + if File.dir?(acc[dep][:path]) do + acc + else + List.keydelete(acc, dep, 0) + end + end) end defp path(app) do |