diff --git a/README.md b/README.md index 7842cb3..3633241 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ 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``` @@ -59,14 +63,31 @@ Create a virtualenv if required and install required packages using "pip install ```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. ``` diff --git a/constants.py b/constants.py deleted file mode 100644 index 515052c..0000000 --- a/constants.py +++ /dev/null @@ -1,4 +0,0 @@ -PROW_VIEW_URL = "https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs" -JOB_LINK_URL= "https://prow.ci.openshift.org/" -RELEASE_URL = "https://ppc64le.ocp.releases.ci.openshift.org/releasestream/4-stable-ppc64le/release/" -HYPERVISOR_CONNECTION_ERROR = "failed to connect to the hypervisor" diff --git a/monitor.py b/monitor.py index a0d7a60..57f3ac2 100644 --- a/monitor.py +++ b/monitor.py @@ -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: