Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
kenherring committed Jan 17, 2025
1 parent 8eea68d commit 9208d56
Show file tree
Hide file tree
Showing 54 changed files with 1,861 additions and 828 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
shellcheck: circleci/shellcheck@3.2.0
shellcheck: circleci/shellcheck@3
sonarcloud: sonarsource/sonarcloud@2.0.0

parameters:
Expand Down
32 changes: 18 additions & 14 deletions .circleci/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,26 @@ run_lint () {
local ESLINT_FILE=artifacts/eslint_report
mkdir -p artifacts

if ! npm run lint -- -f unix -o "${ESLINT_FILE}.txt"; then
echo "eslint plain failed"
fi
if ! npm run lint -- -f json -o "${ESLINT_FILE}.json"; then
## sonarqube report
echo "eslint json failed"
fi
ESLINT_RETURN_CODE=0
npm run lint -- -f json -o "${ESLINT_FILE}.json.tmp" || ESLINT_RETURN_CODE=$?
echo "eslint returned code=$ESLINT_RETURN_CODE"

jq '.' < "${ESLINT_FILE}.json.tmp" > "${ESLINT_FILE}.json"
sed -i 's|/home/circleci/project/|/root/project/|g' "${ESLINT_FILE}.json"
if [ "$(find artifacts -name "eslint_report.json" | wc -l)" != "0" ]; then
jq '.' < "${ESLINT_FILE}.json" > "${ESLINT_FILE}_pretty.json"
else
echo "ERROR: ${ESLINT_FILE}.json not found"
exit 1
fi
echo 'eslint successful'

if [ ! -f "${ESLINT_FILE}.json" ]; then
echo "ERROR: ${ESLINT_FILE}.json not found"
exit 1
fi

MESSAGE_COUNT=$(jq '[.[] | .messages | length] | add' < ${ESLINT_FILE}.json.tmp)
ERROR_COUNT=$(jq '[.[] | .errorCount] | add' < ${ESLINT_FILE}.json.tmp)
WARNING_COUNT=$(jq '[.[] | .warningCount] | add' < ${ESLINT_FILE}.json.tmp)

echo 'eslint summary:'
echo " - message count: $MESSAGE_COUNT"
echo " - error count: $ERROR_COUNT"
echo " - warning count: $WARNING_COUNT"
}

########## MAIN BLOCK ##########
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
*.w linguist-language=OpenEdge-ABL

test_projects/proj1/import_charset.p text working-tree-encoding=UTF-8
test_projects/proj1/openedge-project.proj1.8.json working-tree-encoding=ISO-8859-1
# test_projects/proj1/openedge-project.proj1.8.json working-tree-encoding=ISO-8859-1
22 changes: 11 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"git.branchProtection": [
"main"
],
"extension-test-runner.extractSettings": {
"suite": [
"describe",
"suite"
],
"test": [
"it",
"test"
],
"extractWith": "syntax"
},
// "extension-test-runner.extractSettings": {
// "suite": [
// "describe",
// "suite"
// ],
// "test": [
// "it",
// "test"
// ],
// "extractWith": "syntax"
// },
"files.associations": {
"ablunit-test-profile*.json": "jsonc"
},
Expand Down
8 changes: 8 additions & 0 deletions docker/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@
<echo>compile successful!</echo>
</target>

<target name="extract">
<echo>extracting ${env.DLC}/tty/ablunit.pl</echo>
<copy todir="../resources/tty/ablunit/">
<plfileset src="${env.DLC}/tty/ablunit.pl" includes="**/*" />
</copy>
<echo>extract complete</echo>
</target>

</project>
14 changes: 7 additions & 7 deletions docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ options:
alternative: set the ABLUNIT_TEST_RUNNER_VSCODE_VERSION environment variable
-b drop to bash shell inside container on failure
-B same as -b, but only on error
-C | -d delete volume 'test-runner-cache' before running tests
-C | -d delete volumes 'vscode-cli-cache' and 'test-runner-cache' before running tests
-i run install and run test
-m copy modified files and staged files
-n run tests without coverage
Expand Down Expand Up @@ -120,10 +120,10 @@ initialize () {
fi

## create volume for .vscode-test directory to persist vscode application downloads
if ! docker volume ls | grep -q test-runner-cache; then
echo "creating test-runner-cache volume"
docker volume create --name test-runner-cache
fi
# if ! docker volume ls | grep -q test-runner-cache; then
# echo "creating test-runner-cache volume"
# docker volume create --name test-runner-cache
# fi
if ! docker volume ls | grep -q vscode-cli-cache; then
echo "creating vscode-cli-cache"
docker volume create --name vscode-cli-cache
Expand All @@ -149,7 +149,7 @@ initialize () {
}

run_tests_in_docker () {
echo "[$(date +%Y-%m-%d:%H:%M:%S) $0 ${FUNCNAME[0]}] pwd=$(pwd)"
echo "[$(date +%Y-%m-%d:%H:%M:%S) $0 ${FUNCNAME[0]}] pwd=$(pwd) ABLUNIT_TEST_RUNNER_OE_VERSION=$ABLUNIT_TEST_RUNNER_OE_VERSION"
local ABLUNIT_TEST_RUNNER_OE_VERSION

for ABLUNIT_TEST_RUNNER_OE_VERSION in "${OE_VERSIONS[@]}"; do
Expand Down Expand Up @@ -178,7 +178,7 @@ run_tests_in_docker () {
[ -n "${ABLUNIT_TEST_RUNNER_PROJECT_NAME:-}" ] && ARGS+=(-e ABLUNIT_TEST_RUNNER_PROJECT_NAME)
ARGS+=(
-v "${PWD}":/home/circleci/ablunit-test-runner:ro
-v vscode-cli-cache:/home/circleci/project/.vscode-test
-v "vscode-cli-cache-$ABLUNIT_TEST_RUNNER_OE_VERSION":/home/circleci/project/.vscode-test
kherring/ablunit-test-runner:"${ABLUNIT_TEST_RUNNER_OE_VERSION}"
bash -c "/home/circleci/ablunit-test-runner/docker/$SCRIPT.sh $OPTS;"
)
Expand Down
22 changes: 15 additions & 7 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,24 @@ export default [{
'@typescript-eslint/no-unnecessary-condition': 0,
'no-unused-vars': 'off',

'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
}],
'@typescript-eslint/no-unused-vars': [
'error',
{
'args': 'all',
'argsIgnorePattern': '^_',
'caughtErrors': 'all',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true,
}
],

'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': ['warn', {
considerDefaultExhaustiveForUnions: true,
}],
'promise/catch-or-return': 'warn',
'promise/no-callback-in-promise': 'off',

Expand Down
2 changes: 1 addition & 1 deletion openedge-project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ablunit-test-runner",
"buildPath": [
{ "type": "source", "path": "resources/VSCodeTestRunner", "includes": "**/*.p,**/*.cls"},
{ "type": "source", "path": "resources/VSCodeTestRunner", "includes": "**/*.p,**/*.cls", "build": "resources/VSCodeTestRunner"},
{ "type": "propath", "path": "${DLC}/tty/ablunit.pl", "includes": "**/*" }
],
"buildDirectory": "target"
Expand Down
Loading

0 comments on commit 9208d56

Please sign in to comment.