Skip to content

Commit

Permalink
Merge pull request #2085 from dafyddj/test/remove-git-dep
Browse files Browse the repository at this point in the history
test: remove unused `Travis` feature
  • Loading branch information
twangboy authored Mar 12, 2024
2 parents 4b60d66 + 756f8e7 commit 9d51fa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .cicd/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
import getopt
import git
import glob
import magic
import requests
Expand Down Expand Up @@ -37,7 +36,6 @@ def usage():
print("""
Use either of these flags!
-h | --help_ Show this help_
-t | --travis Run in travis (ignores files that have not been changed in last commit)
-c | --cron Run in cron mode
-d | --debug Run in debug mode (Prints more info)
Expand All @@ -47,17 +45,15 @@ def usage():

try:
opts, args = getopt.getopt(
sys.argv[1:], "tcdh", ["travis", "cron", "debug", "help_"]
sys.argv[1:], "cdh", ["cron", "debug", "help_"]
)
opts = dict(opts)
except getopt.GetoptError:
usage()
sys.exit(2)
travis, cron, debug, help_ = (False, False, False, False)
cron, debug, help_ = (False, False, False)

for o in opts:
if o in ("-t", "--travis"):
travis = True
if o in ("-c", "--cron"):
cron = True
if o in ("-d", "--debug"):
Expand All @@ -67,7 +63,7 @@ def usage():
help_ = True

printd("opts, args", (opts, args))
printd("travis, cron, debug, help_ ", (travis, cron, debug, help_))
printd("cron, debug, help_ ", (cron, debug, help_))

if help_ or len(opts) < 1 and len(args) < 1:
usage()
Expand Down Expand Up @@ -192,11 +188,7 @@ def process_each(softwares):

count_status["failed"] += 1

if travis:
head = git.Repo(".").commit("HEAD")
changed = [i for i in head.stats.files.keys() if ".sls" in i]
our_files = changed
elif cron:
if cron:
our_files = glob.glob("*.sls")
else:
our_files = args
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup `pip` dependencies
if: steps.changed-files.outputs.sls == 'true'
run: |
salt-pip install python-magic-bin tabulate gitpython
salt-pip install python-magic-bin tabulate
if ($LASTEXITCODE) {
Write-Host ("::error title=salt-pip::salt-pip returned exit code: $LASTEXITCODE")
exit 1
Expand Down

0 comments on commit 9d51fa2

Please sign in to comment.