From acce19ef2f863763141c85ca9b8d5c0baceef869 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sun, 14 Aug 2022 18:29:36 +0200 Subject: [PATCH 1/3] build: fix profile pattern match --- rebar.config.erl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rebar.config.erl b/rebar.config.erl index a4265cae3..17c94374c 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -181,14 +181,10 @@ warn_profile_env() -> %% this function is only used for test/check profiles get_edition_from_profille_env() -> case os:getenv("PROFILE") of - "emqx" -> - ce; - "emqx-" ++ _ -> - ce; - "emqx-enterprise" -> - ee; - "emqx-enterprise-" ++ _ -> + "emqx-enterprise" ++ _ -> ee; + "emqx" ++ _ -> + ce; false -> ee; V -> From 9346d5d0fdb3aea223a1ddba76361ae9e33bf0a1 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sun, 14 Aug 2022 18:38:28 +0200 Subject: [PATCH 2/3] ci: generate per-profile coverdata --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2c3077acc..a363a467d 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ $(REBAR): prepare ensure-rebar3 .PHONY: eunit eunit: $(REBAR) conf-segs - @ENABLE_COVER_COMPILE=1 $(REBAR) eunit -v -c + @ENABLE_COVER_COMPILE=1 $(REBAR) eunit -v -c --cover_export_name $(PROFILE)-eunit .PHONY: proper proper: $(REBAR) @@ -72,7 +72,7 @@ proper: $(REBAR) .PHONY: ct ct: $(REBAR) conf-segs - @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v + @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v --cover_export_name $(PROFILE)-ct .PHONY: static_checks static_checks: @@ -85,7 +85,7 @@ APPS=$(shell $(SCRIPTS)/find-apps.sh) define gen-app-ct-target $1-ct: $(REBAR) @$(SCRIPTS)/pre-compile.sh $(PROFILE) - @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v --cover_export_name $(subst /,-,$1) --suite $(shell $(SCRIPTS)/find-suites.sh $1) + @ENABLE_COVER_COMPILE=1 $(REBAR) ct --name $(CT_NODE_NAME) -c -v --cover_export_name $(PROFILE)-$(subst /,-,$1) --suite $(shell $(SCRIPTS)/find-suites.sh $1) endef $(foreach app,$(APPS),$(eval $(call gen-app-ct-target,$(app)))) From 150465a60008bb87633abc81c021913d78b2467e Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sun, 14 Aug 2022 18:44:16 +0200 Subject: [PATCH 3/3] ci: run eunit and proper tests per build profile --- .github/workflows/run_test_cases.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_test_cases.yaml b/.github/workflows/run_test_cases.yaml index 3b65fe885..b4b797621 100644 --- a/.github/workflows/run_test_cases.yaml +++ b/.github/workflows/run_test_cases.yaml @@ -51,6 +51,12 @@ jobs: eunit_and_proper: needs: prepare runs-on: aws-amd64 + strategy: + fail-fast: false + matrix: + profile: + - emqx + - emqx-enterprise defaults: run: shell: bash @@ -63,14 +69,20 @@ jobs: name: source path: . - name: unzip source code + env: + PROFILE: ${{ matrix.profile }} run: unzip -o -q source.zip # produces eunit.coverdata - name: eunit + env: + PROFILE: ${{ matrix.profile }} working-directory: source run: make eunit # produces proper.coverdata - name: proper + env: + PROFILE: ${{ matrix.profile }} working-directory: source run: make proper @@ -136,7 +148,7 @@ jobs: - uses: actions/upload-artifact@v1 if: failure() with: - name: logs_${{ matrix.otp_release }} + name: logs_${{ matrix.otp_release }}-${{ matrix.profile }} path: source/_build/test/logs ct: @@ -198,7 +210,7 @@ jobs: - uses: actions/upload-artifact@v3 if: failure() with: - name: logs_${{ matrix.otp_release }} + name: logs_${{ matrix.otp_release }}-${{ matrix.profile }} path: source/_build/test/logs make_cover: