Skip to content

Conversation

@smarterclayton
Copy link
Contributor

Uses the provided administrator kubeconfig and runs the tests against
that master. This allows the integration tests to be run against a stock
"openshift start master".

Another change in the master will make local dev cases easier so allowed
registries doesn't have to be customized.

@bparees @legionus

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 23, 2018
@smarterclayton
Copy link
Contributor Author

Here's what the runner will look like:

    # Once admin.kubeconfig exists, executes shared tests
    - name: test
      image: ${LOCAL_IMAGE_TEST_BIN}
      volumeMounts:
      - name: shared-tmp
        mountPath: /tmp/shared
      - name: artifacts
        mountPath: /tmp/artifacts
      command:
      - /bin/bash
      - -c
      - |
        #!/bin/bash
        set -euo pipefail

        trap 'touch /tmp/shared/exit' EXIT
        trap 'kill $(jobs -p); exit 0' TERM

        # wait until the master job creates admin.kubeconfig
        while true; do
          if [[ ! -f /tmp/shared/admin.kubeconfig ]]; then
            sleep 5 & wait
            continue
          fi
          break
        done
        echo "Found kubeconfig"
        export KUBECONFIG=/tmp/shared/admin.kubeconfig
        
        ${COMMAND}

    # Start a standalone master
    - name: control-plane
      image: ${IMAGE_CONTROL_PLANE}
      volumeMounts:
      - name: shared-tmp
        mountPath: /tmp
      - name: artifacts
        mountPath: /tmp/artifacts
      env:
      - name: TYPE
        value: ${CLUSTER_TYPE}
      command:
      - /bin/bash
      - -c
      - |
        #!/bin/bash
        set -euo pipefail
        function teardown() {
          set +e
          echo "Gathering artifacts ..."
        }
        trap 'teardown' EXIT
        trap 'kill $(jobs -p); exit 0' TERM

        ( 
          while true; do
            if [[ -f /tmp/exit ]]; then
              echo "Shutting down"
              kill $$
            fi
            sleep 5 & wait
          done
        ) &

        mkdir /tmp/cluster && cd /tmp/cluster
        openshift start master --write-config=/tmp
        openshift start master --config=/tmp/master-config.yaml

@smarterclayton
Copy link
Contributor Author

That runner would be shared between test-cmd and this integration test and anyone else who just needs a stock origin master. When we split origin master up, we'll update the shared runner so you don't have to worry about it.

@smarterclayton
Copy link
Contributor Author

Linked the change to openshift to stop defaulting whitelisted registries, to be consistent with install.

Uses the provided administrator kubeconfig and runs the tests against
that master. This allows the integration tests to be run against a stock
"openshift start master".

Another change in the master will make local dev cases easier so allowed
registries doesn't have to be customized.
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 23, 2018
@smarterclayton
Copy link
Contributor Author

I linked in the integration job - if we're ok with these changes, then I'll test those and iterate, but integration should take ~10s with master reuse vs 1m or so.

@bparees
Copy link
Contributor

bparees commented May 23, 2018

so this is just establishing an abstraction where you can either run a master in a container (old behavior) or point the client to an existing cluster via an admin kubeconfig (new behavior), right?

looks reasonable to me as long as the old behavior wasn't customizing the master it started in any meaningful way.

Copy link
Contributor

@dmage dmage left a comment

Choose a reason for hiding this comment

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

Apparently we are not willing to add any integration tests for image pruning and for anything that touches the image collection.

Discussions about #78 were ended this the same conclusions. We need to run tests on a running cluster and make our best to avoid touching global resources. In this case for pruning we'll write only unit tests with a mocked client.

I don't know what we will do with signatures, perhaps we'll keep them without tests. Nobody knows how to use it.

I'll drop the old behaviour as a follow up as it'll be broken when openshift start will be gone.

So, LGTM (it have not tested yet with the new job, right?)

@smarterclayton
Copy link
Contributor Author

Once this is merged I'll start testing the new job against my extra PR.

@dmage
Copy link
Contributor

dmage commented May 24, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2018
@smarterclayton
Copy link
Contributor Author

Testing the job now

@smarterclayton
Copy link
Contributor Author

Now waiting on openshift/origin#19829

Now that projects are cleaned up when the test exits automatically.
Ensures that JUnit reports can be generated
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 24, 2018
@smarterclayton
Copy link
Contributor Author

Two small changes - CrossMount now reuses the project helper (namespaces are guaranteed to be cleaned up when we exit the test) and the makefile for integration now uses test-go to get junit output and artifacts

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 24, 2018

@smarterclayton: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/integration 777e4e1 link /test integration
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@bparees
Copy link
Contributor

bparees commented May 24, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 24, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, dmage, smarterclayton

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [bparees,dmage,smarterclayton]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-docker
Copy link

openshift-docker commented May 24, 2018 via email

@smarterclayton
Copy link
Contributor Author

/test e2e

@openshift-merge-robot openshift-merge-robot merged commit ff73b7f into openshift:master May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants