Преглед на файлове

Merge pull request #8717 from zmstone/0814-ci-fix-missing-coverage

0814 ci fix missing coverage
Xinyu Liu преди 3 години
родител
ревизия
e8dc7bc1b0
променени са 3 файла, в които са добавени 20 реда и са изтрити 12 реда
  1. 14 2
      .github/workflows/run_test_cases.yaml
  2. 3 3
      Makefile
  3. 3 7
      rebar.config.erl

+ 14 - 2
.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:

+ 3 - 3
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))))
 

+ 3 - 7
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 ->