Skip to content

Commit 17513cf

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 17513cf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

deps/rabbitmq_cli/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/deps/
2+
/logs

deps/rabbitmq_cli/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ 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")
126+
$(if $(filter khepri,$(RABBITMQ_METADATA_STORE)),,RABBITMQ_FEATURE_FLAGS="-khepri_db"); \
127+
rm -f logs; \
128+
log_dir=$$(../../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
127131
$(gen_verbose) $(MIX_TEST) \
128132
$(if $(RABBITMQ_METADATA_STORE),--exclude $(filter-out $(RABBITMQ_METADATA_STORE),khepri mnesia),) \
129133
$(TEST_FILE); \
@@ -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)