-
Notifications
You must be signed in to change notification settings - Fork 8
test: add pairing logic to toolchain-e2e #16
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
Changes from 4 commits
daf4b34
be26196
cedc8c8
39bf4ba
8046aad
a6c26c9
db84024
50bf95e
c913c2f
785d468
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ########################################################### | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one thing I'm missing is the Is that being exposed somewhere else ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! But I guess that will not be passed to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, thanks for explaining. I'll try it out later on 👍 |
||
| # | ||
| # End-to-end Tests | ||
| # | ||
| ########################################################### | ||
|
|
||
| E2E_REPO_PATH := "" | ||
| PUBLISH_UI ?= false | ||
| DEPLOY_UI ?= true | ||
|
|
||
| .PHONY: test-e2e-local | ||
| test-e2e-local: | ||
| $(MAKE) test-e2e E2E_REPO_PATH=${PWD}/../toolchain-e2e PUBLISH_UI=true DEPLOY_UI=true | ||
|
|
||
| .PHONY: publish-current-bundles-for-e2e | ||
| publish-current-bundles-for-e2e: get-e2e-repo | ||
| # build & publish the bundles via toolchain-e2e repo | ||
| $(MAKE) -C ${E2E_REPO_PATH} publish-current-bundles-for-e2e UI_REPO_PATH=${PWD} | ||
|
|
||
| .PHONY: test-e2e | ||
| test-e2e: get-e2e-repo | ||
| # run the e2e test via toolchain-e2e repo | ||
| $(MAKE) -C ${E2E_REPO_PATH} prepare-and-deploy-e2e test-devsandbox-dashboard-e2e UI_REPO_PATH=${PWD} PUBLISH_UI=${PUBLISH_UI} DEPLOY_UI=${DEPLOY_UI} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit confused, why the Also, I'm a bit confused with the mix of the usages of the I'm comparing it with the other repos where we have the same logic and it's not matching.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I set them on that file for being clear which are the default values (if not present there, the person who is looking for the code needs to search in toolchain-e2e to figure it out the default values). But I can just mention in a comment, I will change it, thanks!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MatousJobanek, afterall, the vars config was needed for calling test-e2e (if not set, that vars will be empty) and the run will fail, example: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_release/72470/rehearse-72470-pull-ci-codeready-toolchain-devsandbox-dashboard-pairing_logic_to_toolchain-e2e-e2e/1999129264741421056 So, I will drop all the config of that vars in this repo (a6c26c9), since we can simply to do this in toolchain-e2e side: codeready-toolchain/toolchain-e2e#1233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
stupid me 🤦♂️
ah, right. yeah, that makes sense 👍 |
||
|
|
||
| .PHONY: test-e2e-local-in-container | ||
| test-e2e-local-in-container: | ||
| # run the e2e test via toolchain-e2e repo | ||
| $(MAKE) test-e2e-in-container E2E_REPO_PATH=${PWD}/../toolchain-e2e | ||
|
|
||
| .PHONY: test-e2e-in-container | ||
| test-e2e-in-container: get-e2e-repo | ||
| # run the e2e test via toolchain-e2e repo | ||
| $(MAKE) -C ${E2E_REPO_PATH} prepare-and-deploy-e2e test-devsandbox-dashboard-in-container UI_REPO_PATH=${PWD} | ||
|
|
||
| .PHONY: clean-e2e | ||
| clean-e2e: get-e2e-repo | ||
| $(MAKE) -C ${E2E_REPO_PATH} clean-devsandbox-dashboard | ||
|
|
||
| .PHONY: get-e2e-repo | ||
| get-e2e-repo: | ||
| ifeq ($(E2E_REPO_PATH),"") | ||
| # set e2e repo path to tmp directory | ||
| $(eval E2E_REPO_PATH = /tmp/toolchain-e2e) | ||
| # delete to have clear environment | ||
| rm -rf ${E2E_REPO_PATH} | ||
| # clone | ||
| git clone https://github.com/codeready-toolchain/toolchain-e2e.git ${E2E_REPO_PATH} | ||
| ifneq ($(CI),) | ||
| ifneq ($(GITHUB_ACTIONS),) | ||
| $(eval BRANCH_NAME = ${GITHUB_HEAD_REF}) | ||
| $(eval AUTHOR_LINK = https://github.com/${AUTHOR}) | ||
| else | ||
| $(eval AUTHOR_LINK = $(shell jq -r '.refs[0].pulls[0].author_link' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]')) | ||
| @echo "found author link ${AUTHOR_LINK}" | ||
| $(eval BRANCH_NAME := $(shell jq -r '.refs[0].pulls[0].head_ref' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]')) | ||
| endif | ||
| @echo "using author link ${AUTHOR_LINK}" | ||
| @echo "detected branch ${BRANCH_NAME}" | ||
| # check if a branch with the same ref exists in the user's fork of toolchain-e2e repo | ||
| $(eval REMOTE_E2E_BRANCH := $(shell curl ${AUTHOR_LINK}/toolchain-e2e.git/info/refs?service=git-upload-pack --output - 2>/dev/null | grep -a "refs/heads/${BRANCH_NAME}$$" | awk '{print $$2}')) | ||
| @echo "branch ref of the user's fork: \"${REMOTE_E2E_BRANCH}\" - if empty then not found" | ||
| # check if the branch with the same name exists, if so then merge it with master and use the merge branch, if not then use master | ||
| if [[ -n "${REMOTE_E2E_BRANCH}" ]]; then \ | ||
| git config --global user.email "devsandbox@redhat.com"; \ | ||
| git config --global user.name "KubeSaw"; \ | ||
| # add the user's fork as remote repo \ | ||
| git --git-dir=${E2E_REPO_PATH}/.git --work-tree=${E2E_REPO_PATH} remote add external ${AUTHOR_LINK}/toolchain-e2e.git; \ | ||
| # fetch the branch \ | ||
| git --git-dir=${E2E_REPO_PATH}/.git --work-tree=${E2E_REPO_PATH} fetch external ${REMOTE_E2E_BRANCH}; \ | ||
| # merge the branch with master \ | ||
| git --git-dir=${E2E_REPO_PATH}/.git --work-tree=${E2E_REPO_PATH} merge --allow-unrelated-histories --no-commit FETCH_HEAD; \ | ||
| fi; | ||
| endif | ||
| endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also CRC didn't worked for me - the rdhd pod was crashloopbacking and not deploying properly ( for some still unknown reason 😞 ) , this was the error in the logs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange because I was able to pull the image 🤨 Maybe we could contact rhdh team, what do you think? TBH, I do not use CRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems all good:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S. Going to try with CRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it just fails when the rhdh installer tries to pull it.
If I try to pull it with skopeo on my Mac it works.