Skip to content

Commit ddb747d

Browse files
committed
rabbitmq_cli: Create a symlink to test node's logs
[Why] This doesn't replicate the common_test logs layout, but it will be good enough to let our GitHub Actions workflow to upload the logs without specific instructions in the workflow.
1 parent 57786ab commit ddb747d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

deps/rabbitmq_cli/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ tests:: escript test-deps
123123
$(verbose) $(MAKE) -C ../../ install-cli
124124
$(verbose) $(MAKE) -C ../../ start-background-broker \
125125
PLUGINS="rabbitmq_federation rabbitmq_stomp rabbitmq_stream_management amqp_client" \
126-
$(if $(filter khepri,$(RABBITMQ_METADATA_STORE)),,RABBITMQ_FEATURE_FLAGS="-khepri_db")
127-
$(gen_verbose) $(MIX_TEST) \
126+
$(if $(filter khepri,$(RABBITMQ_METADATA_STORE)),,RABBITMQ_FEATURE_FLAGS="-khepri_db"); \
127+
rm -f logs; \
128+
log_dir=$$(../rabbit/sbin/rabbitmqctl eval 'io:format("~s~n", [maps:get(log_base_dir,rabbit_prelaunch:get_context())]).'); \
129+
log_dir=$$(echo "$$log_dir" | head -n 1); \
130+
ln -s "$$log_dir" logs
131+
$(gen_verbose) : $(MIX_TEST) \
128132
$(if $(RABBITMQ_METADATA_STORE),--exclude $(filter-out $(RABBITMQ_METADATA_STORE),khepri mnesia),) \
129133
$(TEST_FILE); \
130134
RES=$$?; \
@@ -160,7 +164,7 @@ endif
160164
clean:: clean-mix
161165

162166
clean-mix:
163-
$(gen_verbose) rm -f $(ESCRIPT_FILE) $(LINKED_ESCRIPTS)
167+
$(gen_verbose) rm -f $(ESCRIPT_FILE) $(LINKED_ESCRIPTS) logs
164168
$(verbose) echo y | mix clean
165169

166170
format:

0 commit comments

Comments
 (0)