Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
confirm IT solutions
Development Guidelines
Commits
a68b3483
Commit
a68b3483
authored
Nov 14, 2021
by
Dominique Barton
🦄
Browse files
TEST: Fix testing by using diff
parent
30e574c7
Pipeline
#13294
passed with stage
in 1 minute
Changes
15
Pipelines
19
Hide whitespace changes
Inline
Side-by-side
test/Makefile
View file @
a68b3483
...
...
@@ -25,21 +25,21 @@ install: install-python install-node
#
test-isort
:
./
validateOutput.sh
"isort --sp ../configs/isort.cfg -c files/test.py"
output/isort.txt
./
test-command
"isort --sp ../configs/isort.cfg -c
test-
files/test.py"
expected-
output/isort.txt
test-pycodestyle
:
./
validateOutput.sh
"pycodestyle --config=../configs/tox.ini files/test.py"
output/pycodestyle.txt
./
test-command
"pycodestyle --config=../configs/tox.ini
test-
files/test.py"
expected-
output/pycodestyle.txt
test-pylint
:
./
validateOutput.sh
"pylint --rcfile=../configs/pylintrc --score=n files/test.py"
output/pylint.txt
./
test-command
"pylint --rcfile=../configs/pylintrc --score=n
test-
files/test.py"
expected-
output/pylint.txt
test-coverage
:
./
validateOutput.sh
"coverage run --rcfile=../configs/coveragerc files/test.py"
output/coverage.txt
./
test-command
"coverage run --rcfile=../configs/coveragerc
test-
files/test.py"
expected-
output/coverage.txt
test-eslint
:
./
validateOutput.sh
"npx --silent eslint -c ../configs/eslintrc.yml files/test.js"
output/eslint.txt
./
test-command
"npx --silent eslint -c ../configs/eslintrc.yml
test-
files/test.js"
expected-
output/eslint.txt
test-stylelint
:
./
validateOutput.sh
"npx --silent stylelint --config ../configs/stylelintrc.yml files/test.css"
output/stylelint.txt
./
test-command
"npx --silent stylelint
--no-color
--config ../configs/stylelintrc.yml
test-
files/test.css"
expected-
output/stylelint.txt
test
:
test-isort test-pycodestyle test-pylint test-coverage test-eslint
test/output/coverage.txt
→
test/
expected-
output/coverage.txt
View file @
a68b3483
File moved
test/output/eslint.txt
→
test/
expected-
output/eslint.txt
View file @
a68b3483
{PWD}/files/test.js
{PWD}/
test-
files/test.js
1:1 error Identifier 'invalid_name' is not in camel case camelcase
1:1 error 'invalid_name' is not defined no-undef
...
...
test/expected-output/isort.txt
0 → 100644
View file @
a68b3483
ERROR: {PWD}/test-files/test.py Imports are incorrectly sorted and/or formatted.
test/expected-output/pycodestyle.txt
0 → 100644
View file @
a68b3483
test-files/test.py:9:1: W391 blank line at end of file
test/expected-output/pylint.txt
0 → 100644
View file @
a68b3483
************* Module test
test-files/test.py:9:0: C0305: Trailing newlines (trailing-newlines)
test-files/test.py:8:0: C0103: Constant name "invalid_name" doesn't conform to UPPER_CASE naming style (invalid-name)
test-files/test.py:5:0: W0611: Unused import sys (unused-import)
test-files/test.py:6:0: W0611: Unused import os (unused-import)
test/output/stylelint.txt
→
test/
expected-
output/stylelint.txt
View file @
a68b3483
files/test.css
3:23 ✖ Expected "#000" to be "#000000" color-hex-length
4:23 ✖ Unexpected named color "black" color-named
7:1 ✖ Unexpected duplicate selector "body", first used at line 1 no-duplicate-selectors
11:1 ✖ Unexpected unknown type selector "foo" selector-type-no-unknown
13:5 ✖ Unexpected empty line before declaration declaration-empty-line-before
test-
files/test.css
3:23 ✖ Expected "#000" to be "#000000" color-hex-length
4:23 ✖ Unexpected named color "black" color-named
7:1 ✖ Unexpected duplicate selector "body", first used at line 1 no-duplicate-selectors
11:1 ✖ Unexpected unknown type selector "foo" selector-type-no-unknown
13:5 ✖ Unexpected empty line before declaration declaration-empty-line-before
19:1 ✖ Unexpected empty line before closing brace block-closing-brace-empty-line-before
test/output/isort.txt
deleted
100644 → 0
View file @
30e574c7
ERROR: {PWD}/files/test.py Imports are incorrectly sorted and/or formatted.
test/output/pycodestyle.txt
deleted
100644 → 0
View file @
30e574c7
files/test.py:9:1: W391 blank line at end of file
test/output/pylint.txt
deleted
100644 → 0
View file @
30e574c7
************* Module test
files/test.py:9:0: C0305: Trailing newlines (trailing-newlines)
files/test.py:8:0: C0103: Constant name "invalid_name" doesn't conform to UPPER_CASE naming style (invalid-name)
files/test.py:5:0: W0611: Unused import sys (unused-import)
files/test.py:6:0: W0611: Unused import os (unused-import)
test/test-command
0 → 100755
View file @
a68b3483
#!/bin/bash
# Create temporary files.
GIVEN
=
$(
mktemp
/tmp/
$(
basename
$0
)
.XXXX
)
EXPECTED
=
$(
mktemp
/tmp/
$(
basename
$0
)
.XXXX
)
# Cleanup temporary files on exit.
trap
'rm -f ${GIVEN} ${EXPECTED}'
EXIT
# Write given output and expected output to temporary files.
${
1
}
>
${
GIVEN
}
2>&1
cat
${
2
}
|
sed
"s|{PWD}|
$(
pwd
)
|g"
>
${
EXPECTED
}
# Compare given and expected output.
echo
">
${
1
}
"
diff
-ubB
${
GIVEN
}
${
EXPECTED
}
||
exit
echo
test/files/test.css
→
test/
test-
files/test.css
View file @
a68b3483
File moved
test/files/test.js
→
test/
test-
files/test.js
View file @
a68b3483
File moved
test/files/test.py
→
test/
test-
files/test.py
View file @
a68b3483
File moved
test/validateOutput.sh
deleted
100755 → 0
View file @
30e574c7
#!/bin/bash
echo
"--------------------------------------------------------------------------------"
echo
"Command:"
echo
${
1
}
GIVEN
=
$(
${
1
}
2>&1
)
echo
echo
"Given:"
echo
"
${
GIVEN
}
"
echo
echo
"Expected:"
EXPECTED
=
$(
cat
${
2
}
)
EXPECTED
=
${
EXPECTED
//\{PWD\
}
/
$(
pwd
)
}
echo
"
${
EXPECTED
}
"
echo
if
[[
"
${
GIVEN
}
"
==
"
${
EXPECTED
}
"
]]
then
echo
"==> VALIDATION SUCCESSFUL!"
EXIT_CODE
=
0
else
echo
"==> VALIDATION FAILED!"
EXIT_CODE
=
1
fi
echo
"--------------------------------------------------------------------------------"
exit
${
EXIT_CODE
}
Dominique Barton
🦄
@dbarton
mentioned in issue
#20 (closed)
·
Nov 14, 2021
mentioned in issue
#20 (closed)
mentioned in issue #20
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment