Skip to content

Commit

Permalink
Merge branch 'lop-devops:master' into jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
misanjumn committed Jul 22, 2024
2 parents f83713d + e1f25cf commit 7812e32
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 54 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7","3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pip install Inspektor==0.5.3
inspekt checkall --disable-style E501,E265,W601,W605,E402,E722,E741,E115,E0606 --no-license-check
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

27 changes: 18 additions & 9 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def test_analysis(data):

# Loop through the 'tests' list in the JSON data and add rows
for i, test in enumerate(data['tests']):
dataframe.loc[i + 8] = [test['name'], test['status'], test['fail_reason']]
dataframe.loc[i + 8] = [test['name'],
test['status'], test['fail_reason']]

# Save the DataFrame to a Excel file
dataframe.to_excel('Analysis.xlsx', index=False)
Expand Down Expand Up @@ -111,15 +112,17 @@ def comparison_analysis(excel, data):
found = 0
for j in range(len(test_names)):
if test['name'] == test_names[j]:
new_dataframe.loc[j + 8] = [test['status'], test['fail_reason']]
new_dataframe.loc[j + 8] = [test['status'],
test['fail_reason']]
found = 1
break
if found == 0:
new = [test['name']]
for i in range(len(old_dataframe.columns)-1):
new.append("")
old_dataframe.loc[len(old_dataframe.index)] = new
new_dataframe.loc[len(old_dataframe.index)-1] = [test['status'], test['fail_reason']]
new_dataframe.loc[len(old_dataframe.index) -
1] = [test['status'], test['fail_reason']]

final_res = pd.concat([old_dataframe, new_dataframe], axis=1)
final_res.to_excel(excel, index=False)
Expand Down Expand Up @@ -179,26 +182,32 @@ def deco(excel):
for cell in row:
cell.font = Font(size=15)
cell.border = Border(left=Side(border_style='thin', color='000000'),
right=Side(border_style='thin', color='000000'),
right=Side(border_style='thin',
color='000000'),
top=Side(border_style='thin', color='000000'),
bottom=Side(border_style='thin', color='000000'))
cell.alignment = Alignment(wrap_text=True, vertical='center')

# Apply header formatting
for cell in worksheet[1]:
cell.font = Font(size=18, bold=True) # White text color
cell.fill = PatternFill(start_color='ADD8E6', end_color='ADD8E6', fill_type='solid') # Blue background color
# Blue background color
cell.fill = PatternFill(start_color='ADD8E6',
end_color='ADD8E6', fill_type='solid')

# Conditional formatting for the "Result" column if present
try:
for idx, value in enumerate(dataframe['Result'], start=2):
cell = worksheet.cell(row=idx, column=6)
if value == 'DIFF':
cell.fill = PatternFill(start_color='FF0000', end_color='FF0000', fill_type='solid') # Red
cell.fill = PatternFill(
start_color='FF0000', end_color='FF0000', fill_type='solid') # Red
elif value == 'SOLVED':
cell.fill = PatternFill(start_color='39E75F', end_color='39E75F', fill_type='solid') # Green
cell.fill = PatternFill(
start_color='39E75F', end_color='39E75F', fill_type='solid') # Green
elif value == 'REGRESSION':
cell.fill = PatternFill(start_color='FFA500', end_color='FFA500', fill_type='solid') # Orange
cell.fill = PatternFill(
start_color='FFA500', end_color='FFA500', fill_type='solid') # Orange
except Exception as e:
pass

Expand Down Expand Up @@ -248,4 +257,4 @@ def usage():


if __name__ == '__main__':
main()
main()
5 changes: 4 additions & 1 deletion avocado-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
logger = logger_init(filepath=BASE_PATH).getlogger()
prescript_dir = CONFIGFILE.get('script-dir', 'prescriptdir')
postscript_dir = CONFIGFILE.get('script-dir', 'postscriptdir')
args = None
outputdir = ''
pipManager = None


class TestSuite():
Expand Down Expand Up @@ -673,7 +676,7 @@ def parse_test_config(test_config_file, avocado_bin, enable_kvm):
bootstraped = True

if args.run_tests:
with open("%s/host/dynamic_test_suite" % TEST_CONF_PATH+".cfg","w+") as fp:
with open("%s/host/dynamic_test_suite" % TEST_CONF_PATH+".cfg", "w+") as fp:
fp.write('\n'.join(args.run_tests.split(",")))
args.run_suite = str(args.run_suite)+","+"host_dynamic_test_suite"

Expand Down
1 change: 0 additions & 1 deletion config/tests/guest/libvirt/ras.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ variants:
only unattended_install.import.import.default_install.aio_native

- guest_ras:
dump_dir = '/home'
variants:
- non_acl:
only virsh.dump.positive_test.non_acl
Expand Down
2 changes: 1 addition & 1 deletion lib/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_dist():
dist = re.findall("ID=(\\S+)", line)[0]
except:
pass
elif line.startswith("VERSION="):
elif line.__contains__("VERSION="):
try:
line = line.replace('"', '')
dist_ver = re.findall("VERSION=(\\S+)", line)[0].lower().replace("-", ".")
Expand Down
Loading

0 comments on commit 7812e32

Please sign in to comment.