Giter Club home page Giter Club logo

git-test-commit-automation's People

Contributors

bradleya avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

devotionzhu

git-test-commit-automation's Issues

Feature Request --> hooks/bin/git-setup-TEST-cases.sh - need to add display-help or respond other

Tell us about your feature request:
A clear and concise description of what you want to happen or the change you would like to see. Use a use case to describe how a person would actually use your request to accomplish a goal. Thank you.

-> need to add display-help or respond other because I am losing time trying to found out how to add default hooks directory

Describe how your feature request could work:
Steps to demonstrate your feature request.

  1. Enter -> git-setup-TEST-cases.sh --help

How are you currently working without your feature request?
A description of any alternative solutions or features you've considered or are using today.

-> losing time
  • Command: ( check-markit 4.1.4.803 2020-08-29T22:25:47.061044-05:00 (CDT) https://github.com/BradleyA/markit.git master uadmin )

    -> hooks/bin/setup-git-TEST-cases.sh  3.1.94.1653  2020-09-05T08:15:28.202095-05:00 (CDT)  https://github.com/BradleyA/git-TEST-commit-automation.git  master
    

hooks/EXAMPLES/SA-permission-tar-001 - add

hooks/EXAMPLES/SA-permission-tar-001 - add

 -H, --format FORMAT
       create archive of the given formatFORMAT is one of the following:
       --format=gnu
             GNU tar 1.13.x format
       --format=oldgnu
             GNU format as per tar <= 1.12
       --format=pax
             POSIX 1003.1-2001 (pax) format
       --format=posix
             same as pax
       --format=ustar
             POSIX 1003.1-1988 (ustar) format
       --format=v7
             old V7 tar format
 -j, --bzip2
 -J, --xz
 --lzip
 --lzma
 --lzop
 --old-archive, --portability
       same as --format=v7
 --posix
       same as --format=posix
 -z, --gzip, --gunzip --ungzip
 -Z, --compress, --uncompress

hooks/bin/uninstall-git-TEST-cases.sh - correct incident with not removing TEST directory

hooks/bin/uninstall-git-TEST-cases.sh - correct incident with not removing TEST directories not in the hooks directory

  1. place the tar file in the repository top directory not /tmp
  2. incident all directories are not being removed;
    $ tar -tf /tmp/tmp.sbgTTrzV6x.tar | head -40
    ./template/TEST/template.sh/
    ./template/TEST/template.sh/FVT-setup.sh
    ./template/TEST/template.sh/SA-setup.sh
    ./template/TEST/template.sh/FVT-option-version-001.expected
    ./template/TEST/template.sh/SA-shellcheck-001.expected
    ./template/TEST/template.sh/FVT-setup.sh
    ./template/TEST/template.sh/SA-setup.sh
    ./template/TEST/template.sh/FVT-option-version-001.expected
    ./template/TEST/template.sh/SA-shellcheck-001.expected
    ./github-repository-data/TEST/clone.heading/
    ./github-repository-data/TEST/clone.heading/FVT-static-001
    ./github-repository-data/TEST/clone.heading/FVT-static-001.expected
    ./github-repository-data/TEST/clone.heading/FVT-static-001
    ./github-repository-data/TEST/clone.heading/FVT-static-001.expected
    ./hooks/
    ./hooks/TEST/
    ./hooks/TEST/post-commit/
    ./hooks/TEST/post-commit/SAST-shellcheck-001.expected
    . . .

hooks/EXAMPLES/FVT-option-clean-hooks-00[1-4] - create a test cases to test -c -hooks

Describe:

#    MUST restore deleted test cases because git-TEST-cases.sh -c --hooks , just deleted them
# >>>   remove after debuggiing
echo ">>> May not be able to create a test case without creating a new a new git repository to test these options       <<<"
echo ">>> becasue these options remove/clean all test cases that are not custom or setup or cleanup scripts     <<<"
echo ">>> in the git repository . . .           <<<"
pwd
echo ">>>       <<<"
# >>>   remove after debuggiing
##      echo     "#!/bin/bash" > "${REPOSITORY_DIR}"/hooks/tmp_DIR_"${COMMAND_NAME}"/TEST/tmp_CMD_"${COMMAND_NAME}"/FVT-setup.sh
##      if [[ -x "${REPOSITORY_DIR}"/hooks/tmp_DIR_"${COMMAND_NAME}"/TEST/tmp_CMD_"${COMMAND_NAME}"/FVT-setup.sh ]]  ; then ./FVT-setup.sh ; fi
##      if [[ -x "SA-setup.sh"  ]]  ; then ./SA-setup.sh  ; fi

Version:

  • Command: hooks/EXAMPLES/FVT-option-clean-hooks-001

hooks/post-commit - remove test cases after running them

hooks/post-commit - remove test cases after running them

#    run SA-cleanup.sh if found
if [[ -s "${REPOSITORY_DIR}/${COMMIT_PATH}TEST/${COMMIT_FILE_NAME}/SA-cleanup.sh" ]] ; then
  "${REPOSITORY_DIR}/${COMMIT_PATH}TEST/${COMMIT_FILE_NAME}/SA-cleanup.sh" "${REPOSITORY_DIR}"
fi


#    run FVT-cleanup.sh if found
if [[ -s "${REPOSITORY_DIR}/${COMMIT_PATH}TEST/${COMMIT_FILE_NAME}/FVT-cleanup.sh" ]] ; then
  "${REPOSITORY_DIR}/${COMMIT_PATH}TEST/${COMMIT_FILE_NAME}/FVT-cleanup.sh" "${REPOSITORY_DIR}"
fi

<COMMIT_FILE_NAME>.test-case-input - Add support

<COMMIT_FILE_NAME>.test-case-input - Add support

<REPOSITORY>/<PATH>/TEST/<COMMIT_FILE_NAME>/
      FVT-setup.sh  - setting up 'Production standard 10.0 TESTing' test cases
      SA-setup.sh  - setting up 'Production standard 10.0 TESTing' test cases
      FVT-cleanup.sh - remove all directories, files, links, ENVIRONMENT variables, <TEST_CASE_NAME>.test-case-output,etc for test cases
      SA-cleanup.sh - remove all directories, files, links, ENVIRONMENT variables, <TEST_CASE_NAME>.test-case-output, etc for test cases
      <TEST_CASE_NAME>.expected - expected output, error, etc
      <TEST_CASE_NAME>.test-case-output - output produced from test case
      <TEST_CASE_NAME>.test-case-input - input (. . text, directories, files, etc . . .)

hooks/EXAMPLES/SA-setup.sh - allow to be run without post-commit

hooks/EXAMPLES/SA-setup.sh - allow to be run without post-commit

The problem is SA-setup.sh only works when post-commit calls it. It passes REPOSITORY_DIR as ${1}. This is not needed because REPOSITORY_DIR=$(git rev-parse --show-toplevel) can be run inside SA-setup.sh.
Well it was a lot more difficult because once I made the change this script failed when be called from post-commit.

  1. post-commit must pass REPOSITORY_DIR because post-commit is executed in .git/hooks/ which is not in the repository
  2. SA-setup.sh must be executed in the directory it resides

hooks/post-commit - review adding additional options

-i --input   #12 
-q --quiet
-o --output  output directory for reports
--pre  command to run before running tests other that SA-setup.sh |FVT-setup.sh ? not sure this is needed because setup.sh can be edited for custom to do the same thing
--post command to run after running test   ? not sure this is needed because setup.sh can be edited for custom to do the same thing

hooks/EXAMPLES/SA-??? - test with git-secrets, git-hound, and truffleHog

Need to test with git-secrets (Prevents you from committing passwords and other sensitive information to a Git repository), should work git-hound (Git plugin that prevents sensitive data from being committed.) truffleHog (Searches through git repositories for high entropy strings and secrets, digging deep into commit history)

Update README on how the test worked and add knowledge about how to add these pre-commit commands (git-secrets, git-hound, and truffleHog) before unwanted information is committed to the local and remote Git repository.

hooks/EXAMPLES/FVT-setup.sh - allow to be run without post-commit

hooks/EXAMPLES/FVT-setup.sh - allow to be run without post-commit

The problem is FVT-setup.sh only works when post-commit calls it. It passes REPOSITORY_DIR as ${1}. This is not needed because REPOSITORY_DIR=$(git rev-parse --show-toplevel) can be run inside FVT-setup.sh. Thus that is what this is going to fix :-)

Well it was a lot more difficult because once I made the change this script failed when be called from post-commit.

  1. post-commit must pass REPOSITORY_DIR because post-commit is executed in .git/hooks/ which is not in the repository
  2. FVT-setup.sh must be executed in the directory it resides

hooks/post-commit - total number of errors per error wrong

Test case ---> /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/TEST/post-commit/FVT-exit-code-error-124-001 /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/post-commit 124 - Test script logic ERROR - ERROR - ERROR
Test case ---> /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/TEST/post-commit/FVT-exit-code-error-124-002 /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/post-commit 124 - exit code 124: report test case error exit code total - ERROR - ERROR
Test case ---> /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/TEST/post-commit/FVT-exit-code-error-2-001 /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/post-commit 2 - exit code 2: report test case error exit code total - ERROR - ERROR

FVT: post-commit
Number of test cases = 3
Number of test cases pass = 0
Number of test cases fail = 0
Number of test cases error = 3
3 124

hooks/EXAMPLES/SA- add python

bandit - a tool to find common security issues in Python code
bellybutton - a linting engine supporting custom project-specific rules
Black - The uncompromising Python code formatter
cohesion - a tool for measuring Python class cohesion
jedi - autocompletion/static analysis library for Python
linty fresh - parse lint errors and report them to Github as comments on a pull request
mccabe - check McCabe complexity
mypy - a static type checker that aims to combine the benefits of duck typing and static typing, frequently used with MonkeyType
py-find-injection - find SQL injection vulnerabilities in Python code
pycodestyle - (formerly pep8) check Python code against some of the style conventions in PEP 8
pydocstyle - check compliance with Python docstring conventions
pyflakes - check Python source files for errors
pylint - looks for programming errors, helps enforcing a coding standard and sniffs for some code smells. It additionally includes pyreverse (an UML diagram generator) and symilar (a similarities checker).
pyre-check - A fast, scalable type checker for large Python codebases
pyright - Static type checker for Python, created to address gaps in existing tools like mypy.
pyroma - rate how well a Python project complies with the best practices of the Python packaging ecosystem, and list issues that could be improved
PyT - Python Taint - A static analysis tool for detecting security vulnerabilities in Python web applications.
pytype - A static type analyzer for Python code.
radon - a Python tool that computes various metrics from the source code
vulture - find unused classes, functions and variables in Python code
wemake-python-styleguide - the strictest and most opinionated python linter ever
wily - a command-line tool for archiving, exploring and graphing the complexity of Python source code
xenon - monitor code complexity using radon

hooks/bin/uninstall-git-TEST-cases.sh - add git commit tag a message like ‘/hooks/ Remove git-TEST-commit-automation hooks/ recursively

Describe the solution you'd like
A clear and concise description of what you want to happen.
hooks/bin/uninstall-git-TEST-cases.sh - add git commit tag a message like ‘hooks/ Remove git-TEST-commit-automation hooks/ recursively ‘

Also look into changing markup to support a git message before prompting user to enter a message. If git message variable is supported and not size zero then prompt user with git message variable content y/n or something

hooks/bin/EXAMPLES/TEST/SA-shellcheck-001/SA-shellcheck-001

EXAMPLES/TEST/SA-shellcheck-001/SA-shellcheck-001

2019-09-26T18:47:58.426869-05:00 (CDT) five-rpi3b.cptx86.com hooks/post-commit[11384] 2.108.598 87 uadmin 10000:10000 [INFO]    Test case directory found (hooks/EXAMPLES/TEST/SA-shellcheck-001) for Bradley Allen (uadmin).
removed 'SA-permission-775-001'
removed 'SA-shellcheck-001'
Test case ---> /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/EXAMPLES/TEST/SA-shellcheck-001/SA-permission-775-001 /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/EXAMPLES/SA-shellcheck-001 0 - file permission: check mode 775 - PASS - PASS
/home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/EXAMPLES/TEST/SA-shellcheck-001/SA-shellcheck-001: line 91: unexpected EOF while looking for matching `"'
/home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/EXAMPLES/TEST/SA-shellcheck-001/SA-shellcheck-001: line 94: syntax error: unexpected end of file

     SA: SA-shellcheck-001
   Number of test cases = 2
   Number of test cases pass = 1
   Number of test cases fail = 0
   Number of test cases error = 1

hooks/bin/git-TEST-cases.sh - command should have exit if not in git repository

Describe the incident:
hooks/bin/git-TEST-cases.sh - command should have exit if not in git repository

To reproduce the incident:
Steps to reproduce the behavior:

  1. cd ~/github/BradleyA'
  2. git-TEST-cases.sh

Actual results:

151334 uadmin@five-rpi3b: ~/github/BradleyA
 $ git-TEST-cases.sh 
fatal: Not a git repository (or any of the parent directories): .git
docker-security-infrastructure/dockerd-configuration-options/TEST/setup-dockerd.sh
/usr/local/bin/git-TEST-cases.sh: line 277: cd: /docker-security-infrastructure/dockerd-configuration-options/TEST/setup-dockerd.sh: No such file or directory
SA-cleanup.sh
SA-setup.sh
docker-security-infrastructure/dockerd-configuration-options/TEST/uninstall-dockerd-scripts.sh
 /usr/local/bin/git-TEST-cases.sh: line 277: cd: /docker-security-infrastructure/dockerd-configuration-options/TEST/uninstall-dockerd-scripts.sh: No such file or directory
SA-cleanup.sh
SA-setup.sh
docker-security-infrastructure/docker-TLS/TEST/check-ca-tls.sh
/usr/local/bin/git-TEST-cases.sh: line 277: cd: /docker-security-infrastructure/docker-TLS/TEST/check-ca-tls.sh: No such file or directory
FVT-cleanup.sh
SA-cleanup.sh
FVT-setup.sh
SA-setup.sh

Expected results:
ERROR not in local git repository

Version:

  • OS: [e.g. Ubuntu 16.04.6 (lsb_release -a)]
  • Command: hooks/bin/git-TEST-cases.sh 2.210.907

Incident Report - hooks/bin/git-TEST-cases.sh - --filename is used more than once in repository

Tell us about your incident:
A clear and concise description, 'what is your incident?'

-> there is an issue when a --filename is used more than once in repository
->  there is an issue that '/' can not be included in --filename because --filename could of been used as a workaround when there is more than one --filename in the repository

-> add a prompt or user help when there are more then one --filename in the repository

To reproduce your incident:
Steps to reproduce your incident:

  1. Enter -> git-TEST-cases.sh --filename FVT-setup.sh --add

Actual results:
If applicable, add screenshots to help explain your incident.

-> 
272201 uadmin@five-rpi3b: ~/github/BradleyA/markit/TEST/find-code.sh
     A> git-TEST-cases.sh -f FVT-setup.sh --add
/usr/local/bin/git-TEST-cases.sh: line 268: cd: ./TEST/find-code.sh/FVT-setup.sh
./hooks/EXAMPLES/FVT-setup.sh
./hooks/bin/TEST/git-TEST-cases.sh: No such file or directory
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
Untracked files:
    testfiles/version.m4
    testfiles/version.sh
    testfiles/version.tmp

nothing added to commit but untracked files present
/usr/local/bin/git-TEST-cases.sh: line 281: cd: ./TEST/FVT-setup.sh
./hooks/EXAMPLES/TEST/FVT-setup.sh: No such file or directory

    INFO:  If filename is not found.  Check spelling of filename
    or try  git-TEST-cases.sh --filename <FILE_NAME> --hooks
    or try  git-TEST-cases.sh --help

./TEST/find-code.sh/FVT-setup.sh
./TEST/markit/FVT-setup.sh
./TEST/FVT-setup.sh
./TEST/FVT-setup.sh/SA-cleanup.sh
./TEST/FVT-setup.sh/SA-setup.sh
./TEST/FVT-setup.sh/SA-shellcheck-001.expected
./TEST/check-markit/FVT-setup.sh
/usr/local/bin/git-TEST-cases.sh: line 292: cd: ./TEST/FVT-setup.sh
./hooks/EXAMPLES/TEST/FVT-setup.sh: No such file or directory

Expected results:
A clear and concise description of what results you expected.

-> 
  • Command: ( check-markit 4.1.4.803 2020-08-29T22:25:47.061044-05:00 (CDT) https://github.com/BradleyA/markit.git master uadmin )

    -> hooks/bin/git-TEST-cases.sh  3.1.92.1650  2020-08-29T22:13:53.611478-05:00 (CDT)  https://github.com/BradleyA/git-TEST-commit-automation.git  master
    

hooks/EXAMPLES/SA- add go

deadcode - Finds unused code.
dingo-hunter - Static analyser for finding deadlocks in Go.
dupl - Reports potentially duplicated code.
errcheck - Check that error return values are used.
flen - Get info on length of functions in a Go package.
gas - Inspects source code for security problems by scanning the Go AST.
Go Meta Linter - Concurrently run Go lint tools and normalise their output.
go tool vet --shadow - Reports variables that may have been unintentionally shadowed.
go vet - Examines Go source code and reports suspicious.
go-consistent - Analyzer that helps you to make your Go programs more consistent.
go-critic - Go source code linter that maintains checks which are currently not implemented in other linters.
go-staticcheck - go vet on steroids, similar to ReSharper for C#.
go/ast - Package ast declares the types used to represent syntax trees for Go packages.
goconst - Finds repeated strings that could be replaced by a constant.
gocyclo - Calculate cyclomatic complexities of functions in Go source code.
gofmt -s - Checks if the code is properly formatted and could not be further simplified.
goimports - Checks missing or unreferenced package imports.
GolangCI-Lint - Alternative to Go Meta Linter: GolangCI-Lint is a linters aggregator.
golint - Prints out coding style mistakes in Go source code.
goreporter - concurrently runs many linters and normalises their output to a report.
goroutine-inspect - An interactive tool to analyze Golang goroutine dump.
gosimple - Report simplifications in code.
gotype - Syntactic and semantic analysis similar to the Go compiler.
ineffassign - Detect ineffectual assignments in Go code
interfacer - Suggest narrower interfaces that can be used.
lll - Report long lines.
maligned - Detect structs that would take less memory if their fields were sorted.
megacheck - Run staticcheck, gosimple and unused, sharing work.
misspell - Finds commonly misspelled English words.
nakedret - Finds naked returns.
nargs - Finds unused arguments in function declarations.
prealloc - Finds slice declarations that could potentially be preallocated.
revive - Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
safesql - Static analysis tool for Golang that protects against SQL injections.
structcheck - Find unused struct fields.
test - Show location of test failures from the stdlib testing module.
testify - Show location of failed testify assertions.
unconvert - Detect redundant type conversions.
unimport - Finds unnecessary import aliases
unparam - Find unused function parameters.
unused - Find unused variables.
varcheck - Find unused global variables and constants.

hooks/EXAMPLES/SA-setup.sh - open tickets for additional test cases

hooks/EXAMPLES/SA-setup.sh - open tickets for additional test cases

#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-exit-code-error-124-001"   SA-exit-code-error-124-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-exit-code-error-124-002"   SA-exit-code-error-124-002
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-exit-code-error-2-001"     SA-exit-code-error-2-001
#
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-400-001"        SA-permission-400-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-440-001"        SA-permission-440-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-444-001"        SA-permission-444-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-640-001"        SA-permission-640-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-644-001"        SA-permission-644-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-664-001"        SA-permission-664-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-600-001"        SA-permission-600-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-660-001"        SA-permission-660-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-666-001"        SA-permission-666-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-750-001"        SA-permission-750-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-755-001"        SA-permission-755-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-700-001"        SA-permission-700-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-770-001"        SA-permission-770-001
ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-775-001"        SA-permission-775-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-777-001"        SA-permission-777-001
#
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-dir-001"        SA-permission-dir-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-grp-10000-001"  SA-permission-grp-10000-001
#  ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-permission-own-10000-001"  SA-permission-own-10000-001
#
#
ln -fs "${REPOSITORY_DIR}/hooks/EXAMPLES/SA-shellcheck-001"            SA-shellcheck-001

hooks/EXAMPLES/SA-permission-grp-10000-001 - add

hooks/EXAMPLES/SA-permission-grp-10000-001 - add

GROUP_ID_NUM=10000

FILE_GROUP_ID_NUM=$(stat -Lc %g "${1}")
#       GROUP_ID_NAME=$(getent group "${GROUP_ID_NUM}" | cut -d : -f 1)
#       FILE_GROUP_ID_NAME=$(stat -Lc %G "${1}")

hooks/bin/EXAMPLES/TEST/ - custom test cases for FVT options

Create custom FVT- test cases to test the options used by git-TEST-cases.sh

FVT-option-a-001
FVT-option-a-002
FVT-option-add-001
FVT-option-a-hooks-001
FVT-option-a-hooks-001.expected
FVT-option-a-hooks-002
FVT-option-a-hooks-002.expected
FVT-option-c-001
FVT-option-c-002
FVT-option-c-hooks-001
FVT-option-c-hooks-001-bak
FVT-option-c-hooks-001.expected
FVT-option-f-001
FVT-option-n-001

hooks/bin/git-TEST-cases.sh - add option --add default SA-

hooks/bin/git-TEST-cases.sh - add option --add - Add default test case directory (TEST/<FILE_NAME>/) and files SA-setup.sh, SA-cleanup.sh, SA-shellcheck-001.expected

touch sample.sh
git-TEST-cases.sh           
git-TEST-cases.sh -f <FILE_NAME>
TEST/sample.sh

git-TEST-cases.sh -f <FILE_NAME> --add
  mkdir -p TEST/<FILE_NAME>/
  cd TEST/<FILE_NAME>/
  ln -s ../../hooks/EXAMPLES/SA-setup.sh .
  ln -s ../../hooks/EXAMPLES/SA-cleanup.sh .
  touch SA-shellcheck-001.expected
  cd ../..

hooks/EXAMPLES/SA-permission-own-10000-001 - add

hooks/EXAMPLES/SA-permission-own-10000-001 - add

USER_ID_NUM=10000

FILE_USER_ID_NUM=$(stat -Lc %u "${1}")
#       USER_ID_NAME=$(getent passwd "${USER_ID_NUM}" | cut -d : -f 1)
#       FILE_USER_ID_NAME=$(stat -Lc %U "${1}")

.git/hooks/post-commit - if test case not found error message

Describe the incident:
if test case not found error message. Need to add code to prevent and give WARNning
To reproduce the incident:
Steps to reproduce the behavior:

  1. edit

    hooks/bin/TEST/git-TEST-cases.sh/FVT-setup.sh sh
    hooks/bin/git-TEST-cases.sh sh

  2. markit

Actual results:
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-add-001 git-TEST-cases.sh 0 - No difference with expected output - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-all-001 git-TEST-cases.sh 0 - Test file w/ test cases found - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-all-002 git-TEST-cases.sh 0 - Test file w/ test cases found - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-all-hooks-001 git-TEST-cases.sh 0 - Test file w/ test cases found in hooks directory - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-all-hooks-002 git-TEST-cases.sh 0 - Test file w/ test cases found in hooks directory - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-001 git-TEST-cases.sh 0 - No difference with expected output - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-002 git-TEST-cases.sh 0 - No difference with expected output - PASS - PASS
Test case ---> git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-hooks-001 git-TEST-cases.sh 0 - No difference with expected output - PASS - PASS
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-hooks-002: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-hooks-003: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-clean-hooks-004: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-001: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-002: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-003: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-004: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-005: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-006: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-hooks-001: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-hooks-002: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-hooks-003: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-filename-hooks-004: No such file or directory
.git/hooks/post-commit: line 168: /home/uadmin/github/BradleyA/git-TEST-commit-automation/hooks/bin/TEST/git-TEST-cases.sh/FVT-option-help-001: No such file or directory

 FVT: git-TEST-cases.sh

Number of test cases = 22
Number of test cases pass = 8
Number of test cases fail = 0
Number of test cases error = 14
14 127

Expected results:
warning file not found check ./FVT-setup

Version:

Screenshots:
If applicable, add screenshots to help explain your incident.

Feature Request --> hooks/EXAMPLES/[SA-*, FVT-*] - Production standard 2.3.578

Tell us about your feature request:
A clear and concise description of what you want to happen or the change you would like to see. Use a use case to describe how a person would actually use your request to accomplish a goal. Thank you.

-> upgrade Production standard 2.3.529  to  Production standard 2.3.578
    add text colors  BLUE=$(tput   setaf 4) , PURPLE=$(tput setaf 5)
    update all new_message
-> upgrade This script does not support -* or help or usage or version section
    add ${UNDERLINE} 
    add text UNDERLINE=$(tput -Txterm sgr 0 1)  # 0.3.583
-> upgrade Production standard 5.1.160 Copyright  to  Production standard 5.3.559 Copyright
-> upgrade Production standard 1.3.496 DEBUG variable  to  Production standard 1.3.550 DEBUG variable

How are you currently working without your feature request?
A description of any alternative solutions or features you've considered or are using today.

-> without latest template standards

Version:

  • OS ( lsb_release -a ; Ubuntu 14.04 Ubuntu 16.04 Ubuntu 20.04 )

    -> N/A
    
  • Command: ( github-repository/setup.github.repository.sh 2.199.861 )

    -> hooks/EXAMPLES/  all latest
    

Incident Report - setup-git-TEST-cases.sh - received error in git clone local repository

Tell us about your incident:
A clear and concise description, 'what is your incident?'

-> received error in git clone local repository

To reproduce your incident:
Steps to reproduce your incident:

  1. Go to -> git clone https://github.com/BradleyA/markit
  2. Enter -> cd markit/
  3. Edit -> vi markit
  4. Enter -> setup-git-TEST-cases.sh
  5. See error ->
    /usr/local/bin/setup-git-TEST-cases.sh: line 129: unexpected EOF while looking for matching `"'
    /usr/local/bin/setup-git-TEST-cases.sh: line 131: syntax error: unexpected end of file

Actual results:
If applicable, add screenshots to help explain your incident.

-> 031439 uadmin@three-rpi3b: ~/github/BradleyA/markit
     $ ls -la
total 144
drwxrwxr-x 8 uadmin uadmin  4096 Oct  3 14:31 .
drwxrwxr-x 3 uadmin uadmin  4096 Oct  3 14:23 ..
-rw-rw-r-- 1 uadmin uadmin 19057 Oct  3 14:23 CHANGELOG.md
-rwxrwxr-x 1 uadmin uadmin 16570 Oct  3 14:23 check-markit
-rwxrwxr-x 1 uadmin uadmin 14943 Oct  3 14:23 find-code.sh
drwxrwxr-x 8 uadmin uadmin  4096 Oct  3 14:31 .git
drwxrwxr-x 3 uadmin uadmin  4096 Oct  3 14:23 .github
-rw-rw-r-- 1 uadmin uadmin   644 Oct  3 14:23 .gitignore
drwxrwxr-x 2 uadmin uadmin  4096 Oct  3 14:23 images
-rw-rw-r-- 1 uadmin uadmin  1070 Oct  3 14:23 LICENSE
-rwxrwxr-x 1 uadmin uadmin 25645 Oct  3 14:31 markit
drwxrwxr-x 2 uadmin uadmin  4096 Oct  3 14:23 presentation
-rw-rw-r-- 1 uadmin uadmin 14608 Oct  3 14:23 README.md
-rw-rw-r-- 1 uadmin uadmin  1795 Oct  3 14:23 SECURITY.md
drwxrwxr-x 5 uadmin uadmin  4096 Oct  3 14:23 TEST
drwxrwxr-x 2 uadmin uadmin  4096 Oct  3 14:23 testfiles
031439 uadmin@three-rpi3b: ~/github/BradleyA/markit
     $ setup-git-TEST-cases.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                            Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  757k    0  757k    0     0   417k      0 --:--:--  0:00:01 --:--:--  791k
/usr/local/bin/setup-git-TEST-cases.sh: line 129: unexpected EOF while looking for matching `"'
/usr/local/bin/setup-git-TEST-cases.sh: line 131: syntax error: unexpected end of file

Expected results:
A clear and concise description of what results you expected.

->      $ setup-git-TEST-cases.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                            Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  757k    0  757k    0     0   312k      0 --:--:--  0:00:02 --:--:--  473k
    For more information:
    https://github.com/BradleyA/git-TEST-commit-automation/blob/master/hooks/docs/STEPS-TO-EVALUTE.md#installevaluate-git-test-commit-automation-solution
    setup-git-TEST-cases.sh has installed or upgraded git-TEST-commit-automation
    in the current repository.  The following commands git-TEST-cases.sh,
    setup-git-TEST-cases.sh, and uninstall-git-TEST-cases.sh have been copied
    to /usr/local/bin.  Test scripts have been updated with the latest test
    scipts from the remote git repository.  git-TEST-commit-automation runs
    pre-commit & post-commit hooks when git commit -m 'message' is executed.
2020-10-03T15:07:42.627354-05:00 (CDT) three-rpi3b.cptx86.com hooks/bin/setup-git-TEST-cases.sh[11809] 3.1.94.1653 126 uadmin 10000:10000 [INFO]    Operation
  • Command: ( github-repository/setup.github.repository.sh 2.199.861 )

    -> hooks/bin/setup-git-TEST-cases.sh  3.1.94.1653  2020-09-05T08:15:28.202095-05:00 (CDT)  https://github.com/BradleyA/git-TEST-commit-automation.git  master
    

hooks/bin/git-TEST-cases.sh - add option to show TEST cases for hooks/ default is not show

hooks/bin/git-TEST-cases.sh - add option to show TEST cases for hooks/ default is not show

-a --all 1) Print all files with test cases exclude hooks/ (create links)
-c --clean 2) Remove linked TEST cases and run FVT-cleanup.sh & SA-cleanup.sh
-f --filename -f= --filename= 3) Print all TEST cases and files
--hooks 4) Include TEST cases in hooks/ directory (can be used with -a or -c or -n)
-n --none 5) Print all files that do NOT have TEST/<FILE_NAME>/ directory #18

hooks/bin/EXAMPLES - ALL test cases updated NO -x ${1} exit ERROR 126

hooks/bin/EXAMPLES - ALL test cases updated when NO ${1} exit ERROR 126

if [[ ! -x ${1} ]] ; then  #  Command invoked does not exist or cannot execute
  RETURN_CODE=126
  new_message "${SCRIPT_NAME}" "${LINENO}" "ERROR" "${RETURN_CODE} - File, ${1}, does not exist or have execute permission" 1>&2
  echo "${BOLD}Test case --->${NORMAL} ${0} ${1} 126 - File, ${1}, does not exist or have execute permission - ${BOLD}ERROR - ERROR${NORMAL}"
  exit "${RETURN_CODE}"
fi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.