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

Integration test #6

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Integration test #6

wants to merge 3 commits into from

Conversation

allxiao
Copy link
Contributor

@allxiao allxiao commented Nov 1, 2017

No description provided.

export KUBERNETES_CD_DOCKER_PASSWORD="$(az acr credential show --name "$acr_name" --query "passwords[0].value" --output tsv)"
export KUBERNETES_CD_DOCKER_REGISTRY="http://$KUBERNETES_CD_DOCKER_REPOSITORY"

docker pull nginx
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called even if KUBERNETES_CD_DOCKER_REPOSITORY is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention here is:

  • if we test against existing docker repository, we pass in all the details of the repo and then we skip the repository setup
  • otherwise if KUBERNETES_CD_DOCKER_REPOSITORY is empty, we setup new ACR instance and prepare the image for testing

bash src/test/java/com/microsoft/jenkins/kubernetes/integration/integration-test.sh

Prerequisites:
* Logged in Azure CLI
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this plugin is a general k8s plugin, provide an option that user can run the test without Azure (suppose they have already have a k8s cluster)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the user pass in all the details, we will skip the Azure ACS & ACR setup. We have a check to ensure that

resource_group=
if [[ -z "$KUBERNETES_CD_MASTER_HOST" ]] || [[ -z "$KUBERNETES_CD_DOCKER_REPOSITORY" ]]; then
    resource_group="k8s-test-$suffix"
fi

However, currently the check for az account happens too early. It is not necessary if user do not need to provision Azure resources. I will update the code logic and the documentation.

import java.io.OutputStream;
import java.util.UUID;

public class TestHelpers {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move some common methods to common plugin so that they can be reused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sense. I will copy the logic to commons and when that's available in new commons release, we can remove the duplicates in the descendants.

@gavinfish
Copy link
Member

Why not merge this PR? @ArieShout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants