Skip to content

Commit 97df053

Browse files
[DEBUG] more debugging
1 parent 2688da8 commit 97df053

File tree

4 files changed

+55
-44
lines changed

4 files changed

+55
-44
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
shell: /bin/bash
4444
name: "install test depends attempt"
4545
command: |
46-
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
46+
python3 -m pip install --upgrade --user -r ./tests-requirements.txt || : ;
4747
when: on_success
4848
- save_cache:
4949
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
@@ -69,7 +69,7 @@ jobs:
6969
shell: /bin/bash
7070
name: "Installing deps for test"
7171
command: |
72-
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
72+
python3 -m pip install --upgrade --user -r ./tests-requirements.txt || : ;
7373
when: on_success
7474
- cleanup
7575
- run:
@@ -105,7 +105,7 @@ jobs:
105105
shell: /bin/bash
106106
name: "clean up for test"
107107
command: |
108-
python3 -m pip install --upgrade --user -r ./tests/requirements.txt || : ;
108+
python3 -m pip install --upgrade --user -r ./tests-requirements.txt || : ;
109109
when: on_success
110110
- cleanup
111111
- run:
@@ -143,7 +143,7 @@ jobs:
143143
- run:
144144
name: "install test-reqs attempt"
145145
command: |
146-
python3 -m pip install --user -r ./tests/requirements.txt || : ;
146+
python3 -m pip install --user -r ./tests-requirements.txt || : ;
147147
- cleanup
148148
- run:
149149
shell: /bin/bash

.github/workflows/Tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ jobs:
193193
pip install --upgrade "pip>=24.3.1" "setuptools>=45.0" "wheel>=0.37" ;
194194
pip install -r ./requirements.txt ;
195195
pip install -r ./test-requirements.txt || true ;
196+
- name: Pre-Clean
197+
id: clean
198+
run: make -j1 -f Makefile clean || true ;
196199
- name: Install code-climate tools for ${{ matrix.python-version }}
197200
if: ${{ !cancelled() && runner.os != 'Windows' }}
198201
shell: bash
199202
run: ./tests/fetch_cc-test-reporter || true ;
200-
- name: Pre-Clean
201-
id: clean
202-
run: make -j1 -f Makefile clean || true ;
203203
- name: Generate Coverage for py3.9 on ${{ matrix.os }}
204204
if: ${{ runner.python-version == '3.9' }}
205205
run: make -f Makefile test ;

test-requirements.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33
# re - builtin - PSF licence?
44
# subprocess - PSF licence
55
# sphinx
6-
# argparse - builtin - PSF licence
7-
argparse>=1.4.0
8-
# argparse - builtin - PSF licence
9-
setuptools>=38.0
10-
# virtualenv - MIT
11-
virtualenv>=15.0.1
126
# six - MIT
137
six>=1.0.0
148
# pgpy - BSD 3-Clause licensed
159
#pgpy>=0.4.1
1610
tox>=3.0.0
1711
#py>=1.4.33
18-
# pip>=19.0
12+
# setuptools - MIT license
13+
setuptools>=75.0
14+
# virtualenv - MIT license
15+
virtualenv>=20.26.6
16+
# pip - MIT license
17+
pip>=24.3.1
18+
# build - MIT license
19+
build>=1.1.1, !=1.2.2.post1
20+
# python-repo - MIT
21+
#-e git+https://github.com/reactive-firewall/python-repo.git#egg=python-repo
22+
# wheel - MIT license
23+
wheel>=0.44
1924
#
2025
# TESTING ONLY - Do NOT report issues with these optionals on python-repo
2126
#
@@ -30,5 +35,3 @@ pytest-flake8>=1.0
3035
coverage >= 6.3
3136
pytest-cov >= 4.0.0;
3237
pytest-enabler >= 1.0.1
33-
wheel >= 0.37.0
34-
pip >= 21.0

tests/fetch_cc-test-reporter

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@
6565

6666

6767
# to check though:
68-
diff -q <(tail -n 228 "$0" | head -n 226 | shasum -a 384 -t -) <(tail -n 1 "$0") || exit 70 ;
68+
diff -q <(tail -n 229 "$0" | head -n 227 | shasum -a 384 -t -) <(tail -n 1 "$0") || exit 70 ;
6969

7070
ulimit -t 90
7171
PATH="/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:${PATH}"
7272
LANG=${LANG:-"en_US"}
7373
LC_ALL="${LANG:0:5}.utf-8"
74+
export BINDIR="${BINDIR:-./bin}"
7475
umask 127
7576

7677
LOCK_FILE="${TMPDIR:-/tmp}/org.pak.tests.scripts.code-climate.lock"
@@ -118,7 +119,14 @@ case "$ARCH" in
118119
esac
119120

120121
# Set the CI prefix
121-
CI_ENV_PREFIX="${CI_OS}-${ARCH}"
122+
case "${CI_OS:-Linux}" in
123+
*arwin)
124+
CI_ENV_PREFIX="${CI_OS}-amd64"
125+
;;
126+
*)
127+
CI_ENV_PREFIX="${CI_OS}-${ARCH}"
128+
;;
129+
esac
122130

123131
function cleanup() {
124132
rm -f "${LOCK_FILE}" 2>/dev/null || : ; wait ;
@@ -175,12 +183,12 @@ fi
175183
#########################
176184
# actual Work starts here
177185
#########################
178-
curl -fLso ./test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64} https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64} ;
186+
curl -fLso ./test-reporter-latest-${CI_ENV_PREFIX} https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_ENV_PREFIX} ;
179187
for i in 1 256 512 ; do
180-
curl -fLso test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i} "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i}" ; wait ;
181-
curl -fLso test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i}.sig "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i}.sig" ; wait ;
188+
curl -fLso test-reporter-latest-${CI_ENV_PREFIX}.sha${i} "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_ENV_PREFIX}.sha${i}" ; wait ;
189+
curl -fLso test-reporter-latest-${CI_ENV_PREFIX}.sha${i}.sig "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_ENV_PREFIX}.sha${i}.sig" ; wait ;
182190
# test sha1/sha512 signatures if found and sha256 even if not found
183-
if [[ ( -r test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i} ) ]] || [[ ( ${i} -eq 256 ) ]] ; then
191+
if [[ ( -r test-reporter-latest-${CI_ENV_PREFIX}.sha${i} ) ]] || [[ ( ${i} -eq 256 ) ]] ; then
184192
if [[ ${i} -eq 1 ]]; then
185193
printf "%s\n" "WARNING: SHA-1 is deprecated and should be avoided when possible. Consider using SHA-256 or SHA-512 for stronger integrity checks. (CWE-327: Use of a Broken or Risky Cryptographic Algorithm)"
186194
fi
@@ -189,16 +197,16 @@ for i in 1 256 512 ; do
189197
# FP: KEY FP 9BD9 E2DD 46DA 965A 537E 5B0A 5CBF 3202 43B6 FD85
190198
# OR...
191199
# Set CI=true to continue on missing keys
192-
gpg --verify test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i}.sig test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i} || ${CI} 2>/dev/null || ${CIRCLECI} 2>/dev/null || EXIT_CODE=126
193-
rm -vf test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i}.sig 2>/dev/null ;
200+
gpg --verify test-reporter-latest-${CI_ENV_PREFIX}.sha${i}.sig test-reporter-latest-${CI_ENV_PREFIX}.sha${i} || ${CI} 2>/dev/null || ${CIRCLECI} 2>/dev/null || EXIT_CODE=126
201+
rm -vf test-reporter-latest-${CI_ENV_PREFIX}.sha${i}.sig 2>/dev/null ;
194202
fi
195-
shasum -a $i -c --ignore-missing test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i} || EXIT_CODE=126
196-
rm -vf test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64}.sha${i} 2>/dev/null ;
203+
shasum -a $i -c --ignore-missing test-reporter-latest-${CI_ENV_PREFIX}.sha${i} || EXIT_CODE=126
204+
rm -vf test-reporter-latest-${CI_ENV_PREFIX}.sha${i} 2>/dev/null ;
197205
fi
198206
done
199207

200208
if [[ ( ${EXIT_CODE} -eq 0 ) ]] ; then
201-
mv -fv ./test-reporter-latest-${CI_OS:-linux}-${ARCH:-amd64} ./cc-test-reporter 2>/dev/null || EXIT_CODE=126
209+
mv -fv ./test-reporter-latest-${CI_ENV_PREFIX} ./cc-test-reporter 2>/dev/null || EXIT_CODE=126
202210
chmod -v 751 ./cc-test-reporter || EXIT_CODE=77
203211
fi
204212

@@ -241,30 +249,30 @@ elif [[ ( ${EXIT_CODE} -eq 0 ) ]] ; then
241249
printf "::endgroup::\n" ;
242250
if [[ ( ${EXIT_CODE} -eq 0 ) ]] ; then
243251
printf "::debug::%s\n" "Checking for DeepSource CLI" ;
244-
if [[ ( -d ./bin ) ]] ; then
245-
printf "::debug::==> %s\n" "Found ./bin directory." ;
246-
if [[ ( -x ./bin/deepsource ) ]] ; then
247-
printf "::debug:: ==> %s\n" "Found ./bin/deepsource CLI tool" ;
248-
elif [[ ( -r ./bin/deepsource ) || ( -e ./bin/deepsource ) ]] ; then
249-
printf "::debug:: ==> %s\n" "Found ./bin/deepsource file. Permission Error" ;
250-
printf "::debug:: ==> %s\n" "Trying to apply permission corrections" ;
251-
chmod -v 751 ./bin/deepsource || EXIT_CODE=77 ;
252-
if [[ ( ${EXIT_CODE} -eq 0 ) ]] && [[ ( -x ./bin/deepsource ) ]] ; then
253-
printf "::debug:: ==> %s\n" "Fixed ./bin/deepsource CLI tool" ;
252+
if [[ ( -d "${BINDIR}" ) ]] ; then
253+
printf "::debug::=> %s\n" "Found ${BINDIR} directory." ;
254+
if [[ ( -x "${BINDIR}"/deepsource ) ]] ; then
255+
printf "::debug::..=> %s\n" "Found ${BINDIR}/deepsource CLI tool" ;
256+
elif [[ ( -r "${BINDIR}"/deepsource ) || ( -e "${BINDIR}"/deepsource ) ]] ; then
257+
printf "::debug::..=> %s\n" "Found ${BINDIR}/deepsource file." ;
258+
printf "::debug::....=> %s\n" "Trying to apply permission corrections" ;
259+
chmod -v 751 "${BINDIR}"/deepsource || EXIT_CODE=77 ;
260+
if [[ ( ${EXIT_CODE} -eq 0 ) ]] && [[ ( -x "${BINDIR}"/deepsource ) ]] ; then
261+
printf "::debug::......=> %s\n" "Fixed ${BINDIR}/deepsource CLI tool" ;
254262
else
255-
printf "::debug:: ==> %s\n" "Applying corrections Unsuccessful" ;
263+
printf "::debug::....=> %s\n" "Applying corrections Unsuccessful" ;
256264
EXIT_CODE=77 ;
257265
fi ;
258266
else
259-
printf "::debug:: ==> %s\n" "Missing ./bin/deepsource CLI tool" ;
267+
printf "::debug::..=> %s\n" "Missing ${BINDIR}/deepsource CLI tool" ;
260268
EXIT_CODE=125 ;
261-
printf "::debug:: ==> %s\n" "Checking if bin is empty:" ;
262-
readonly BIN_FILES=$( ls -1 ./bin 2>/dev/null ;)
263-
printf "::debug:: ==> %s\n" "${BIN_FILES}" ;
269+
printf "::debug::..=> %s\n" "Checking if ${BINDIR} is empty:" ;
270+
readonly BIN_FILES=$( ls -1 "${BINDIR}" 2>/dev/null ;)
271+
printf "::debug::..=> %s\n" "${BIN_FILES}" ;
264272
unset $BIN_FILES 2>/dev/null || : ;
265273
fi ;
266274
else
267-
printf "::debug::==> %s\n" "Missing ./bin directory." ;
275+
printf "::debug::=> %s\n" "Missing ${BINDIR} directory." ;
268276
EXIT_CODE=125 ;
269277
fi ;
270278
fi ;
@@ -290,4 +298,4 @@ cleanup 2>/dev/null || rm -f "${LOCK_FILE}" 2>/dev/null > /dev/null || : ; wait
290298
exit ${EXIT_CODE:-255} ;
291299

292300
# This file's code hash:
293-
99229c350d321d5557c1833263cdbe4b09271ad374d4f81eb08d19d8ae00c922e3764eaf7ccfb506f6e58171c2ecf5f6 -
301+
c107fcd6c083b3fcfe410ce7fa6017a27c519172511d959f52ded59cd8af8e8648dcd58ff27d624df32284d1a9a4289a -

0 commit comments

Comments
 (0)