Преглед изворни кода

Revert "ci: ct testing with mix"

This reverts commit 53bd2af4d23daf3072797dca562aaf56b235fed1.
Thales Macedo Garitezi пре 1 година
родитељ
комит
a95c9e76a3

+ 0 - 1
.github/workflows/.zipignore2

@@ -1 +0,0 @@
-*/.github/*

+ 1 - 4
.github/workflows/_pr_entrypoint.yaml

@@ -146,12 +146,9 @@ jobs:
         env:
           PROFILE: ${{ matrix.profile }}
           ENABLE_COVER_COMPILE: 1
-          TEST: 1
-          MIX_ENV: ${{ matrix.profile }}-test
         run: |
           make ensure-rebar3
-          # make ${PROFILE}-compile test-compile
-          env PROFILE=${PROFILE}-test mix do deps.get, deps.compile
+          make ${PROFILE}-compile test-compile
           echo "PROFILE=${PROFILE}" | tee -a .env
           echo "PKG_VSN=$(./pkg-vsn.sh ${PROFILE})" | tee -a .env
           zip -ryq -x@.github/workflows/.zipignore $PROFILE.zip .

+ 6 - 18
.github/workflows/run_test_cases.yaml

@@ -54,19 +54,11 @@ jobs:
         run: |
           unzip -o -q ${{ matrix.profile }}.zip
           git config --global --add safe.directory "$GITHUB_WORKSPACE"
-        # TODO: produces eunit.coverdata
+        # produces eunit.coverdata
       - run: make eunit
-        env:
-          PROFILE: ${{ matrix.profile }}-test
-          MIX_ENV: ${{ matrix.profile }}-test
-          TEST: 1
 
-        # TODO produces proper.coverdata
+        # produces proper.coverdata
       - run: make proper
-        env:
-          PROFILE: ${{ matrix.profile }}-test
-          MIX_ENV: ${{ matrix.profile }}-test
-          TEST: 1
 
       - run: make cover
 
@@ -121,7 +113,6 @@ jobs:
           ENABLE_COVER_COMPILE: 1
           CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-sg${{ matrix.suitegroup }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          PROFILE: ${{ matrix.profile }}-test
         run: ./scripts/ct/run.sh --ci --app ${{ matrix.app }} --keep-up
 
       - name: make cover
@@ -140,7 +131,7 @@ jobs:
 
       - name: compress logs
         if: failure()
-        run: tar -czf logs.tar.gz _build/{test,${{ matrix.profile }}-test}/logs
+        run: tar -czf logs.tar.gz _build/test/logs
 
       - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
         if: failure()
@@ -183,11 +174,7 @@ jobs:
 
         # produces $PROFILE-<app-name>-<otp-vsn>-sg<suitegroup>.coverdata
       - name: run common tests
-        env:
-          TEST: 1
-          MIX_ENV: ${{ matrix.profile }}-test
-          PROFILE: ${{ matrix.profile }}-test
-        run: make ensure-hex ensure-mix-rebar3 ensure-mix-rebar "${{ matrix.app }}-ct"
+        run: make "${{ matrix.app }}-ct"
 
       - run: make cover
 
@@ -204,7 +191,7 @@ jobs:
 
       - name: compress logs
         if: failure()
-        run: tar -czf logs.tar.gz _build/{test,${{ matrix.profile }}-test}/logs
+        run: tar -czf logs.tar.gz _build/test/logs
 
       - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
         if: failure()
@@ -236,3 +223,4 @@ jobs:
           git-commit: ${{ github.sha }}
 
       - run: echo "All tests passed"
+          

+ 10 - 17
Makefile

@@ -28,8 +28,6 @@ CT_COVER_EXPORT_PREFIX ?= $(PROFILE)
 
 export REBAR_GIT_CLONE_OPTIONS += --depth=1
 
-ELIXIR_COMMON_DEPS := ensure-hex ensure-mix-rebar3 ensure-mix-rebar
-
 .PHONY: default
 default: $(REBAR) $(PROFILE)
 
@@ -61,22 +59,18 @@ ensure-mix-rebar: $(REBAR)
 	@mix local.rebar --if-missing --force
 
 .PHONY: mix-deps-get
-mix-deps-get: elixir-common-deps
+mix-deps-get: $(ELIXIR_COMMON_DEPS)
 	@mix deps.get
 
-.PHONY: elixir-common-deps
-elixir-common-deps: $(ELIXIR_COMMON_DEPS)
-
 .PHONY: eunit
-eunit: $(REBAR) $(ELIXIR_COMMON_DEPS) merge-config
+eunit: $(REBAR) ${ELIXIR_COMMON_DEPS} merge-config
 	# @$(REBAR) eunit --name eunit@127.0.0.1 -c -v --cover_export_name $(CT_COVER_EXPORT_PREFIX)-eunit
 	# TODO: cover compile
 	mix eunit
 
 .PHONY: proper
 proper: $(REBAR)
-	# @$(REBAR) proper -d test/props -c
-	mix proper
+	@$(REBAR) proper -d test/props -c
 
 .PHONY: test-compile
 test-compile: $(REBAR) merge-config
@@ -120,14 +114,13 @@ define gen-app-ct-target
 $1-ct: $(REBAR) merge-config clean-test-cluster-config
 	$(eval SUITES := $(shell $(SCRIPTS)/find-suites.sh $1))
 ifneq ($(SUITES),)
-	mix ct --suites $(SUITES)
-	# $(REBAR) ct -v \
-	# 	--readable=$(CT_READABLE) \
-	# 	--name $(CT_NODE_NAME) \
-	# 	$(call cover_args,$1) \
-	# 	--suite $(SUITES) \
-	# 	$(GROUPS_ARG) \
-	# 	$(CASES_ARG)
+	$(REBAR) ct -v \
+		--readable=$(CT_READABLE) \
+		--name $(CT_NODE_NAME) \
+		$(call cover_args,$1) \
+		--suite $(SUITES) \
+		$(GROUPS_ARG) \
+		$(CASES_ARG)
 else
 	@echo 'No suites found for $1'
 endif

+ 2 - 5
scripts/ct/run.sh

@@ -104,7 +104,7 @@ ERLANG_CONTAINER='erlang'
 DOCKER_CT_ENVS_FILE="${WHICH_APP}/docker-ct"
 
 if [ -f "${WHICH_APP}/BSL.txt" ]; then
-    if [ -n "${PROFILE:-}" ] && ! [[ "${PROFILE}" =~ emqx-enterprise* ]]; then
+    if [ -n "${PROFILE:-}" ] && [ "${PROFILE}" != 'emqx-enterprise' ]; then
         echo "bad_profile: PROFILE=${PROFILE} will not work for app ${WHICH_APP}"
         exit 1
     fi
@@ -327,11 +327,8 @@ else
                     -e SUITEGROUP="${SUITEGROUP:-}" \
                     -e ENABLE_COVER_COMPILE="${ENABLE_COVER_COMPILE:-}" \
                     -e CT_COVER_EXPORT_PREFIX="${CT_COVER_EXPORT_PREFIX:-}" \
-                    -e TEST=1 \
-                    -e MIX_ENV="${PROFILE}" \
-                    -e BUILD_WITHOUT_QUIC=1 \
                     -i $TTY "$ERLANG_CONTAINER" \
-                    bash -c "make ensure-hex ensure-mix-rebar3 ensure-mix-rebar; mix do deps.get, deps.compile; make ${WHICH_APP}-ct"
+                    bash -c "BUILD_WITHOUT_QUIC=1 make ${WHICH_APP}-ct"
     else
         # this is an ad-hoc run
         docker exec -e IS_CI="$IS_CI" \