Skip to content

Commit 234f924

Browse files
committed
print logs in test
1 parent 5732a49 commit 234f924

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

features/src/utils/opt/devcontainer/bin/post-attach-command.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#! /usr/bin/env bash
22

33
if ! test -n "${SKIP_DEVCONTAINER_UTILS_POST_ATTACH_COMMAND:+x}"; then
4+
sudo mkdir -m 0777 -p /var/log/devcontainer-utils;
5+
sudo touch /var/log/devcontainer-utils/creds-s3.log;
6+
sudo chmod 0777 /var/log/devcontainer-utils/creds-s3.log;
7+
48
# shellcheck disable=SC1091
59
. devcontainer-utils-init-git-interactive;
610

features/src/utils/opt/devcontainer/bin/sccache/dist/status.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ EOF
7878
# Passthrough if the format is csv or json
7979
# Otherwise, transform the csv into a tsv.
8080
if test "$f" = tsv; then
81-
if [[ "$(grep DISTRIB_RELEASE= /etc/lsb-release | cut -d= -f2)" > "18.04" ]]; then
81+
if [[ "$(grep DISTRIB_RELEASE= /etc/lsb-release | cut -d= -f2)" > "20.04" ]]; then
8282
cat - | sed 's/\"//g' | column -t -s, -R $(seq -s, 1 13)
8383
else
8484
cat - | sed 's/\"//g' | column -t -s,

features/test/utils/ubuntu18.04.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ reset_state() {
5454
devcontainer-utils-stop-sccache --kill-all;
5555
done
5656

57-
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
57+
sudo rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config /var/log/devcontainer-utils/creds-s3.log;
5858
cp /tmp/.bashrc-clean ~/.bashrc;
5959
sudo cp /usr/bin/sccache{.orig,};
6060
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
@@ -203,12 +203,13 @@ if test -n "${gh_token:+x}" \
203203

204204
no_creds_with_GH_TOKEN_AWS_ROLE_ARN_and_SCCACHE_BUCKET_should_generate_credentials() {
205205
reset_state;
206-
devcontainer_utils_debug='*' \
207206
GH_TOKEN="${gh_token}" \
208207
AWS_ROLE_ARN="${aws_role_arn}" \
209208
SCCACHE_BUCKET="${rw_sccache_bucket}" \
210209
SCCACHE_REGION="${rw_sccache_region}" \
211210
devcontainer-utils-post-attach-command;
211+
echo "creds-s3.log:";
212+
sudo cat /var/log/devcontainer-utils/creds-s3.log;
212213
expect_s3_cache_is_used;
213214
}
214215

features/test/utils/ubuntu20.04.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ reset_state() {
5454
devcontainer-utils-stop-sccache --kill-all;
5555
done
5656

57-
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
57+
sudo rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config /var/log/devcontainer-utils/creds-s3.log;
5858
cp /tmp/.bashrc-clean ~/.bashrc;
5959
sudo cp /usr/bin/sccache{.orig,};
6060
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
@@ -203,12 +203,13 @@ if test -n "${gh_token:+x}" \
203203

204204
no_creds_with_GH_TOKEN_AWS_ROLE_ARN_and_SCCACHE_BUCKET_should_generate_credentials() {
205205
reset_state;
206-
devcontainer_utils_debug='*' \
207206
GH_TOKEN="${gh_token}" \
208207
AWS_ROLE_ARN="${aws_role_arn}" \
209208
SCCACHE_BUCKET="${rw_sccache_bucket}" \
210209
SCCACHE_REGION="${rw_sccache_region}" \
211210
devcontainer-utils-post-attach-command;
211+
echo "creds-s3.log:";
212+
sudo cat /var/log/devcontainer-utils/creds-s3.log;
212213
expect_s3_cache_is_used;
213214
}
214215

features/test/utils/ubuntu22.04.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ reset_state() {
5454
devcontainer-utils-stop-sccache --kill-all;
5555
done
5656

57-
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
57+
sudo rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config /var/log/devcontainer-utils/creds-s3.log;
5858
cp /tmp/.bashrc-clean ~/.bashrc;
5959
sudo cp /usr/bin/sccache{.orig,};
6060
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
@@ -203,12 +203,13 @@ if test -n "${gh_token:+x}" \
203203

204204
no_creds_with_GH_TOKEN_AWS_ROLE_ARN_and_SCCACHE_BUCKET_should_generate_credentials() {
205205
reset_state;
206-
devcontainer_utils_debug='*' \
207206
GH_TOKEN="${gh_token}" \
208207
AWS_ROLE_ARN="${aws_role_arn}" \
209208
SCCACHE_BUCKET="${rw_sccache_bucket}" \
210209
SCCACHE_REGION="${rw_sccache_region}" \
211210
devcontainer-utils-post-attach-command;
211+
echo "creds-s3.log:";
212+
sudo cat /var/log/devcontainer-utils/creds-s3.log;
212213
expect_s3_cache_is_used;
213214
}
214215

0 commit comments

Comments
 (0)