Skip to content

Commit be49c97

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 be49c97

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/test-make-target.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,6 @@ jobs:
143143
name: CT logs (${{ inputs.plugin }} ${{ inputs.make_target }} OTP-${{ inputs.erlang_version }} ${{ inputs.metadata_store }}${{ inputs.mixed_clusters && ' mixed' || '' }})
144144
path: |
145145
logs/
146+
deps/rabbitmq_cli/logs/
146147
# !logs/**/log_private
147148
if-no-files-found: ignore

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)