jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

BDD for jx import fails when using vault #5751

Closed ccojocar closed 4 years ago

ccojocar commented 5 years ago

Summary

The BDD test for jx import command fails when used with vault - https://github.com/jenkins-x/bdd-jx/blob/8a39801d3455dbe6e8381698e60ea111f485bf9c/test/suite/_import/jx_import.go#L24.

The error messages from the logs:

STEP: running ** get applications -e staging
      RUNNER:About to execute ** get applications -e staging in /tmp/bdd-130197412 with timeout 5m0s expecting exit code 0
      RUNNER:Execution completed with exit code 0
STEP: parsing the output of ** get applications -e staging
STEP: validating that the application bdd-ghf**y-import-1570549662 was returned by ** get applications -e staging
STEP: getting url for application bdd-ghf**y-import-1570549662
      still looking for application bdd-ghf**y-import-1570549662 in env staging
STEP: getting http://bdd-ghf**y-import-1570549662.**-staging.c**d2.bdd.jenkins-x.rocks

• Failure [943.257 seconds]
Creating application golang-http-from-jenkins-x-yml
/tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:34
  by running ** import
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:52
    creates an application from the specified folder and promotes it to staging [It]
    /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53

    send request to deployed application
    Unexpected error:
        <*url.Error | 0xc00044a120>: {
            Op: "Get",
            URL: "http://bdd-ghf**y-import-1570549662.**-staging.c**d2.bdd.jenkins-x.rocks",
            Err: {
                err: "net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
                timeout: true,
            },
        }
        Get http://bdd-ghf**y-import-1570549662.**-staging.c**d2.bdd.jenkins-x.rocks: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    occurred

    /tmp/jenkins-x/bdd-**/test/helpers/test.go:160
------------------------------
------------------------------
Creating application spring-boot-http-gradle by running ** import
  creates an application from the specified folder and promotes it to staging
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53
STEP: calling git clone https://github.com/jenkins-x-quickstarts/spring-boot-http-gradle
Enumerating objects: 157, done.
Total 157 (delta 0), reused 0 (delta 0), pack-reused 157
STEP: removing the .git directory
STEP: updating the pom.xml (if exists) to have the correct application name
STEP: running ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com
      RUNNER:About to execute ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com in /tmp/bdd-130197412 with timeout 1h0m0s expecting exit code 0
WARNING: error finding vault service url setting to empty string, err: getting ingress for service "**-vault-pr-27-35-boot" in namespace **: ingresses.extensions "**-vault-pr-27-35-boot" not found
ERROR: error finding ingress for **-vault-pr-27-35-boot in namespace ** - err ingresses.extensions "**-vault-pr-27-35-boot" not found
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
Waiting for vault to be initialized and unsealed...
error: wait for vault to be initialized and unsealed: reading vault health: Get /v1/sys/health?drsecondarycode=299&performancestandbycode=299&sealedcode=299&standbycode=299&uninitcode=299: unsupported protocol scheme ""
      RUNNER:Execution completed with exit code 1
      FAILED got unexpected error:

expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com

• Failure [630.542 seconds]
Creating application spring-boot-http-gradle
/tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:34
  by running ** import
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:52
    creates an application from the specified folder and promotes it to staging [It]
    /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53

    error is printed in log
    Unexpected error:
        <*errors.fundamental | 0xc000649420>: {
            msg: "expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com",
            stack: [0x160ff48, 0x160fa9d, 0x1618676, 0x175419f, 0x15fa5a0, 0x17548cf, 0x15e9f6c, 0x15e9bdf, 0x15e9074, 0x15f0046, 0x15ef8f4, 0x15f583f, 0x15f5354, 0x15f4b97, 0x15f71fe, 0x15f9bd7, 0x15f991d, 0x1613db2, 0x17550f0, 0x5041c
0, 0x45eaf1],
        }
        expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com
    occurred

    /tmp/jenkins-x/bdd-**/test/utils/expects.go:13

• Failure [630.542 seconds]
Creating application spring-boot-http-gradle
/tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:34
  by running ** import
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:52
    creates an application from the specified folder and promotes it to staging [It]
    /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53

    error is printed in log
    Unexpected error:
        <*errors.fundamental | 0xc000649420>: {
            msg: "expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com",
            stack: [0x160ff48, 0x160fa9d, 0x1618676, 0x175419f, 0x15fa5a0, 0x17548cf, 0x15e9f6c, 0x15e9bdf, 0x15e9074, 0x15f0046, 0x15ef8f4, 0x15f583f, 0x15f5354, 0x15f4b97, 0x15f71fe, 0x15f9bd7, 0x15f991d, 0x1613db2, 0x17550f0, 0x5041c
0, 0x45eaf1],
        }
        expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbhg-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com
    occurred

    /tmp/jenkins-x/bdd-**/test/utils/expects.go:13
------------------------------
Creating application spring-boot-rest-prometheus by running ** import
  creates an application from the specified folder and promotes it to staging
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53
STEP: calling git clone https://github.com/jenkins-x-quickstarts/spring-boot-rest-prometheus
Enumerating objects: 94, done.
Total 94 (delta 0), reused 0 (delta 0), pack-reused 94
STEP: removing the .git directory
STEP: updating the pom.xml (if exists) to have the correct application name
STEP: running ** import /tmp/bdd-130197412/bdd-sbrp-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com
      RUNNER:About to execute ** import /tmp/bdd-130197412/bdd-sbrp-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com in /tmp/bdd-130197412 with timeout 1h0m0s expecting exit code 0
Unable to connect to the server: dial tcp 35.187.56.29:443: i/o timeout
      RUNNER:Execution completed with exit code 1
      FAILED got unexpected error:

expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbrp-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com

• Failure [31.078 seconds]
Creating application spring-boot-rest-prometheus
/tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:34
  by running ** import
  /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:52
    creates an application from the specified folder and promotes it to staging [It]
    /tmp/jenkins-x/bdd-**/test/suite/_import/**_import.go:53

    error is printed in log
    Unexpected error:
        <*errors.fundamental | 0xc0006e3b60>: {
            msg: "expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbrp-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com",
            stack: [0x160ff48, 0x160fa9d, 0x1618676, 0x175419f, 0x15fa5a0, 0x17548cf, 0x15e9f6c, 0x15e9bdf, 0x15e9074, 0x15f0046, 0x15ef8f4, 0x15f583f, 0x15f5354, 0x15f4b97, 0x15f71fe, 0x15f9bd7, 0x15f991d, 0x1613db2, 0x17550f0, 0x5041c
0, 0x45eaf1],
        }
        expected exit code 0 but got 1 whilst running command ** import /tmp/bdd-130197412/bdd-sbrp-import-1570549662 -b --org cb-kubecd --git-provider-url https://github.com
    occurred

    /tmp/jenkins-x/bdd-**/test/utils/expects.go:13
------------------------------

Summarizing 3 Failures:

[Fail] Creating application golang-http-from-jenkins-x-yml by running ** import [It] creates an application from the specified folder and promotes it to staging
/tmp/jenkins-x/bdd-**/test/helpers/test.go:160

[Fail] Creating application spring-boot-http-gradle by running ** import [It] creates an application from the specified folder and promotes it to staging
/tmp/jenkins-x/bdd-**/test/utils/expects.go:13

[Fail] Creating application spring-boot-rest-prometheus by running ** import [It] creates an application from the specified folder and promotes it to staging
/tmp/jenkins-x/bdd-**/test/utils/expects.go:13

Ran 4 of 4 Specs in 2155.994 seconds
FAIL! -- 1 Passed | 3 Failed | 0 Pending | 0 Skipped

Steps to reproduce the behavior

Expected behavior

Actual behavior

Jx version

The output of jx version is:

COPY OUTPUT HERE

Jenkins type

Kubernetes cluster

Operating system / Environment

jenkins-x-bot commented 4 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

jenkins-x-bot commented 4 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle rotten

jenkins-x-bot commented 4 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten. Provide feedback via https://jenkins-x.io/community. /close

jenkins-x-bot commented 4 years ago

@jenkins-x-bot: Closing this issue.

In response to [this](https://github.com/jenkins-x/jx/issues/5751#issuecomment-627664233): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. >Provide feedback via https://jenkins-x.io/community. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository.