Skip to content
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

Added a script to build CDAP sandbox and reverted the changes from run_e2e_test.py #237

Merged

Conversation

Vipinofficial11
Copy link
Contributor

@Vipinofficial11 Vipinofficial11 commented Dec 11, 2023

  1. Added a script to build CDAP sandbox and upload plugins to run e2e tests on latest CDAP code.
  2. Reverted the changes made to run_e2e_tests as they are not needed anymore. (They were implemented to run e2e on CDAP only)

Script Testing : Tested the scripts on a self hosted runner to make sure changes are working.

Screenshot 2023-12-13 at 10 33 31

@Vipinofficial11 Vipinofficial11 force-pushed the revertChangesFrome2eScritps branch from 648a596 to 3333bfe Compare December 13, 2023 04:59
@Vipinofficial11 Vipinofficial11 changed the title reverting the changes made to run_e2e_test.py Added a script to build CDAP sandbox and reverted the changes from run_e2e_test.py Dec 13, 2023
run_shell_command('mvn clean package -pl cdap-standalone,cdap-app-templates/cdap-etl -am -amd -DskipTests -P '
f'templates,dist,release,unit-tests -Dadditional.artifacts.dir=../../hydrator-plugins/')
os.chdir("./cdap-standalone/target")
sandbox_zip = "cdap-sandbox-6.11.0-SNAPSHOT.zip"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not hardcode sandbox version, you can simply find it in the target folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a method to find the version of the sandbox. (ad2e033)

my_env["_JAVA_OPTIONS"] = "-Xmx32G"
# Building the plugins
os.chdir("..")
hydrator_repository_url = "https://github.com/cdapio/hydrator-plugins.git"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to use the same script for release branches, we will need to compute hydrator-plugins branch as well from cdap-build repo based on cdap branch: https://github.com/cdapio/cdap-build/blob/f785173eb3274b4b9d06e162ce09b9671b2eb091/.gitmodules#L8

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a logic to get the base branch (ex: develop) from e2e.yaml and then based on it we clone cdap-build repo and the look for hydrator-plugins branch in gitmodules. (0bed67d)

e2e.yaml workflow

- name: Run all e2e tests
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || steps.filter.outputs.e2e-test == 'true'
 run: python3 e2e/src/main/scripts/run_cdap_e2e_test.py --testRunner TestRunnerRequired.java --cdapBranch "${{ github.event.pull_request.base.ref }}"

Testing output :

Screenshot 2023-12-21 at 13 04 54

@Vipinofficial11 Vipinofficial11 force-pushed the revertChangesFrome2eScritps branch from f3924ff to 0bed67d Compare December 21, 2023 07:37
os.chdir("..")
# Extracting hydrator-plugins branch from cdap-build gitmodules.
cdap_branch = ""
if args.cdapBranch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if cdapBranch is not present should we fail the workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. Added a check to fail the workflow in case the cdapBranch is empty (fdbc415)

Copy link
Member

@itsankit-google itsankit-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment, otherwise LGTM

@Vipinofficial11 Vipinofficial11 force-pushed the revertChangesFrome2eScritps branch from fdbc415 to 366d622 Compare December 26, 2023 15:23
@Vipinofficial11
Copy link
Contributor Author

Squashed the commits, merging the PR.

@Vipinofficial11 Vipinofficial11 merged commit 8e07def into cdapio:develop Dec 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants