-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Younis-Ahmed/main
Testing Suite was created
- Loading branch information
Showing
19 changed files
with
898 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Unit testing application | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint pycodestyle colorama pytest pytest-mock | ||
- name: Install ctags | ||
run: sudo apt-get update && sudo apt-get install -y exuberant-ctags | ||
- name: Install betty | ||
run: | | ||
sudo ./bettyfixer/install_dependency/.Betty/install.sh && | ||
sudo mv bettyfixer/install_dependency/.Betty/betty.sh /bin/betty | ||
- name: Create test-results directory | ||
run: mkdir -p test-results | ||
- name: Test with pytest | ||
run: | | ||
pytest --junitxml=test-results/results.xml | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: pytest-results | ||
path: test-results | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
main.c | ||
__pycache__/ | ||
*.pyc | ||
.coverage | ||
htmlcov/ | ||
launch.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/env bash | ||
|
||
# Get the current date and time | ||
CURRENT_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
|
||
# Get the name of the person from git config | ||
NAME=$(git config --get user.name) | ||
|
||
# path from the root of project to the directory where the log files will be saved | ||
PATHLOG=$(git rev-parse --show-toplevel)/errors_logs/linting | ||
# Check if pylint is installed | ||
if ! command -v pylint &> /dev/null | ||
then | ||
echo "pylint is not installed" | ||
exit 1 | ||
fi | ||
|
||
# Check if person's name is set in git config | ||
if [ -z "$(git config --get user.name)" ] | ||
then | ||
echo "Please set your name in git config" | ||
exit 1 | ||
fi | ||
|
||
|
||
if [ ! -d "$PATHLOG" ] | ||
then | ||
mkdir -p "$PATHLOG" | ||
fi | ||
# Loop over all command line arguments | ||
for file in "$@" | ||
do | ||
# Change the file suffix to .txt | ||
filename=$(basename "$file") | ||
output_file="${filename%.py}.txt" | ||
|
||
echo -e "\n\nName: $NAME\n" >> "${PATHLOG}/${output_file}" | ||
echo -e "Date: $CURRENT_DATE\n" >> "${PATHLOG}/${output_file}" | ||
pylint "$file" | ||
# Run pylint with the current command line argument | ||
pylint "$file" --reports=y -f parseable >> "${PATHLOG}/${output_file}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.