From 59a9827b1fa97a8259807d49aeb89b605e458b82 Mon Sep 17 00:00:00 2001 From: jabahum Date: Thu, 28 Nov 2024 09:22:14 +0300 Subject: [PATCH] remove tests files --- e2e_test_support_files/README.md | 52 ---------------- .../commit_and_export_images.sh | 16 ----- .../docker-compose-build.yml | 59 ------------------- e2e_test_support_files/docker-compose.yml | 26 -------- e2e_test_support_files/extract_tag_numbers.sh | 27 --------- 5 files changed, 180 deletions(-) delete mode 100644 e2e_test_support_files/README.md delete mode 100644 e2e_test_support_files/commit_and_export_images.sh delete mode 100644 e2e_test_support_files/docker-compose-build.yml delete mode 100644 e2e_test_support_files/docker-compose.yml delete mode 100644 e2e_test_support_files/extract_tag_numbers.sh diff --git a/e2e_test_support_files/README.md b/e2e_test_support_files/README.md deleted file mode 100644 index 39d633da..00000000 --- a/e2e_test_support_files/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Run E2E Tests on Release PRs - -This GitHub Actions workflow, named "Run E2E Tests on Release PRs," serves as Quality Gate #4 in the slide -deck [O3 Release QA pipeline](https://docs.google.com/presentation/d/1k3DH74Mz1Afnrgy2MpwR5HQK5vMpVx0pTfN1na62lvI/edit#slide=id.g165af5ac0be_0_24). - -The workflow is designed to automate the end-to-end (E2E) testing process for release pull requests (PRs) -that opened in the format described in -here: [How to Release the O3 RefApp](https://wiki.openmrs.org/display/projects/How+to+Release+the+O3+RefApp) - -The workflow is conditional and **only runs if the pull request title starts with "(release)"**. - -Below is an overview of the key components of the workflow: - - -## Job: build - -This job prepares the test environment, extracts version numbers, builds and runs Docker containers, and uploads -artifacts for use in subsequent E2E testing jobs. - -### Checking out to the release commit - -The reason for the step: - -```yaml -- name: Checkout to the release commit - run: git checkout 'HEAD^{/\(release\)}' -``` - -is to ensure that the workflow checks out to the specific release commit associated with the pull request. This is -necessary because the pull request contain both release commits and revert commits, and the goal is to specifically -target the release commit for further processing. - -## End-to-End Test Jobs - -The workflow includes several end-to-end test jobs, each corresponding to a specific components of O3 (frontend -mono-repos). These jobs are structured similarly and are listed below: - -* `run-patient-management-e2e-tests` -* `run-patient-chart-e2e-tests` -* `run-form-builder-e2e-tests` -* `run-esm-core-e2e-tests` -* `run-cohort-builder-e2e-tests` - -In each "End-to-End Test Job," the workflow first checks out the repository associated with a specific OpenMRS -component. It then downloads Docker images from a previous "build" job, loads these images, and starts an OpenMRS instance. - -### Why Check Out to the Tags? - -The workflow checks out a specific tagged version of the component's repository, the tag is imported from the previous " -build" job. This is necessary because the goal is to perform end-to-end tests on the codebase that corresponds to a -particular release version, rather than the code at the head of the repository. In case of using pre-releases, it checkouts -to the main branch as we don't create tags for pre-releases. diff --git a/e2e_test_support_files/commit_and_export_images.sh b/e2e_test_support_files/commit_and_export_images.sh deleted file mode 100644 index 384699d1..00000000 --- a/e2e_test_support_files/commit_and_export_images.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -backend_container_id=$(docker ps --filter "name=backend" --format "{{.ID}}") -db_container_id=$(docker ps --filter "name=db" --format "{{.ID}}") -frontend_container_id=$(docker ps --filter "name=frontend" --format "{{.ID}}") -gateway_container_id=$(docker ps --filter "name=gateway" --format "{{.ID}}") - -docker commit $frontend_container_id frontend -docker commit $gateway_container_id gateway -docker commit $backend_container_id backend -docker commit $db_container_id db - -docker save frontend gateway backend db > e2e_release_env_images.tar - -# compress the file (to decrease the upload file size) -gzip -c e2e_release_env_images.tar > e2e_release_env_images.tar.gz diff --git a/e2e_test_support_files/docker-compose-build.yml b/e2e_test_support_files/docker-compose-build.yml deleted file mode 100644 index a4527ce0..00000000 --- a/e2e_test_support_files/docker-compose-build.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: "3.7" - -services: - gateway: - build: - context: ../gateway - container_name: gateway - restart: "unless-stopped" - depends_on: - - frontend - - backend - ports: - - "80:80" - - frontend: - build: - context: ../frontend - container_name: frontend - restart: "unless-stopped" - environment: - SPA_PATH: /openmrs/spa - API_URL: /openmrs - SPA_CONFIG_URLS: - SPA_DEFAULT_LOCALE: - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost/" ] - timeout: 5s - depends_on: - - backend - - backend: - build: - context: ../ - container_name: backend - depends_on: - - db - environment: - OMRS_CONFIG_MODULE_WEB_ADMIN: "true" - OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true" - OMRS_CONFIG_CREATE_TABLES: "true" - OMRS_CONFIG_CONNECTION_SERVER: db - OMRS_CONFIG_CONNECTION_DATABASE: openmrs - OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs} - OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs} - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs" ] - timeout: 5s - - # MariaDB - db: - image: mariadb:10.8.2 - container_name: db - command: "mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --datadir=/openmrs-db" - environment: - MYSQL_DATABASE: openmrs - MYSQL_USER: ${OPENMRS_DB_USER:-openmrs} - MYSQL_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs} - MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs} - diff --git a/e2e_test_support_files/docker-compose.yml b/e2e_test_support_files/docker-compose.yml deleted file mode 100644 index f36ef81d..00000000 --- a/e2e_test_support_files/docker-compose.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: "3.7" - -services: - gateway: - image: gateway - restart: "unless-stopped" - depends_on: - - frontend - - backend - ports: - - "8080:80" - - frontend: - image: frontend - restart: "unless-stopped" - depends_on: - - backend - - backend: - image: backend - restart: "unless-stopped" - - db: - image: db - restart: "unless-stopped" - diff --git a/e2e_test_support_files/extract_tag_numbers.sh b/e2e_test_support_files/extract_tag_numbers.sh deleted file mode 100644 index 4f5f98ea..00000000 --- a/e2e_test_support_files/extract_tag_numbers.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# Define a function to extract and output a dependency value -get_repository_tag() { - local file="$1" - local repo_name="$2" - local app="$3" - - local version=$(awk -F'"' -v app="$app" '$0 ~ app {print $4}' "$file") - local ref="refs/tags/v$version" - - # Check if the version number contains "pre" and modify the ref to main branch - if [[ $version == *"pre"* ]]; then - ref="main" - fi - - echo "$repo_name=$ref" -} - -file_path="frontend/spa-assemble-config.json" - -# Call the function for each Repository with the app as the second argument -get_repository_tag "$file_path" "patient_management" "@openmrs/esm-patient-registration-app" >> "$GITHUB_OUTPUT" -get_repository_tag "$file_path" "patient_chart" "@openmrs/esm-patient-chart-app" >> "$GITHUB_OUTPUT" -get_repository_tag "$file_path" "esm_core" "@openmrs/esm-login-app" >> "$GITHUB_OUTPUT" -get_repository_tag "$file_path" "form_builder" "@openmrs/esm-form-builder-app" >> "$GITHUB_OUTPUT" -get_repository_tag "$file_path" "cohort_builder" "@openmrs/esm-cohort-builder-app" >> "$GITHUB_OUTPUT"