Skip to content

Updated readme file. #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,42 @@ Create a virtualenv if required and install required packages using "pip install
4. The CI_DailyBuildUpdates.py script when invoked with command line arguments info_type as "detailed" and zone, it will display the builds details in the provided zone.

```python3 CI_DailyBuildUpdates.py --info_type detailed --zone syd04```

5. The CI_DailyBuildUpdates.py script when invoked with command line arguments info_type as "detailed" and --job_type as "pa", it will display the builds details in the given job type.

```python3 CI_DailyBuildUpdates.py --info_type detailed --job_type pa```



2. **CI_JobHistory.py:** The CI_JobHistory.py is a script which allows user to query a specific information from all builds that ran on the CI system within a given date range.

```python3 CI_JobHistory.py```

```python3 CI_Jobhistory.py --zone ``` This command line allows user to fetch querry based on zone type.

```python3 CI_Jobhistory.py --job_type ``` This command line allows user to fetch querry based on job type.

```python3 CI_Jobhistory.py --filter ``` This command line allows user to fetch querry based on search filter.


1. Interactive Execution: The CI_JobHistory.py can be executed in a interactive mode by setting JENKINS variable as False in config.ini file.

2. Non-Interactive Execution: The CI_JobHistory.py can be executed in a non-interactive mode by setting JENKINS variable as True in config.ini file, along with the JENKINS variable user needs to provide values for the following variables:
```
selected_ci: CI's from where to fetch the jobs.
query_option: Query code to fetch information from builds.
• Check Node Crash: Detects if a node crashed during execution.
• Brief Job Information: Provides a summary of job execution.
• Detailed Job Information: Fetches in-depth details of jobs.
• Failed Test Cases: Lists test cases that failed in the CI run.
• Get Builds with Test Case Failures: Identifies builds where given test cases failed.
• Test Case Failure Frequency: Analyzes how often test cases fail.
• Get Build Based on Release: Retrieves builds corresponding to a specific release
release: Provide initial release
next release: provide latest release

before_date: End date.
after_date: Start date.
query_option: Query code to fetch information from builds.
tc_name: Testcase name which will be used in quering the failure frequency.
```

Expand Down
4 changes: 0 additions & 4 deletions constants.py

This file was deleted.

19 changes: 13 additions & 6 deletions monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@ def fetch_release_date(release):
'''
Returns the created date of release
'''
url = constants.RELEASE_URL + release

try:
url = constants.STABLE_RELEASE_URL + release
response = requests.get(url, verify=False, timeout=15)
if response.status_code == 404:
url = constants.DEV_PREVIEW_RELEASE_URL + release
response = requests.get(url, verify=False, timeout=15)
if response.status_code == 404:
print(f"Failed to get the release page. {response.text}")
sys.exit(1)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
p_elements = soup.find_all("p")
for p in p_elements:
soup = BeautifulSoup(response.text, 'html.parser')
p_elements = soup.find_all("p")
for p in p_elements:
p_ele = p.string
if p_ele:
if "Created:" in p_ele:
start_date = p_ele.split(" ")[1]+" "+p_ele.split(" ")[2]
break
return start_date
else:
return start_date
else:
print(f"Failed to get the release page. {response.text}")
sys.exit(1)
except requests.Timeout as e:
Expand Down