Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Create an application/service in the new environment and push configu… #265

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Conversation

varshab1210
Copy link
Member

…ration to GitOps repository scenarios

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

#136

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?

#136

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Aug 5, 2021
@openshift-ci openshift-ci bot requested review from jannfis and keithchong August 5, 2021 10:40
@varshab1210 varshab1210 changed the title Create an application/service in the new environment and push configu… [WIP]: Create an application/service in the new environment and push configu… Aug 5, 2021
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2021
When executing "kam service add --env-name new-env --app-name app-bus --service-name bus --git-repo-url $GIT_REPO_URL --pipelines-folder $GITOPS_PATH" succeeds
Then stderr should be empty

Scenario: Commit and Push configuration to GitOps repoository
Copy link
Contributor

Choose a reason for hiding this comment

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

This scenario is not required. Please remove it

@varshab1210
Copy link
Member Author

/retest

1 similar comment
@varshab1210
Copy link
Member Author

/retest

@varshab1210
Copy link
Member Author

I tested the pr locally and it went fine. I am not sure why its failing in CI. Can you please take a look @amitkrout

$ make e2e
Log successfully started, logging into: /home/varshab/go/src/github.com/redhat-developer/kam/test/e2e/out/test-results/e2e_2021-8-10_13-13-39.log
Running e2e test in: /home/varshab/go/src/github.com/redhat-developer/kam/test/e2e/out/test-run
Working directory set to: /home/varshab/go/src/github.com/redhat-developer/kam/test/e2e/out/test-run
Before suite
The bash instance has been started and will be used for testing.
Before feature
Feature: Basic test
  Checks whether KAM top-level commands behave correctly.
Before scenario

  Scenario: KAM version                                    # features/basic.feature:5
    When executing "kam version" succeeds                  # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then stderr should be empty                            # shell.go:302 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldBeEmpty
    And stdout should match "kam\sversion\sv\d+\.\d+\.\d+" # shell.go:326 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldMatch
After scenario
2021/08/10 13:13:39 unable to delete repository: Not Found
Before scenario

  Scenario: Execute KAM bootstrap command without --push-to-git=true flag                                                                                                                                                                                 # features/basic.feature:10
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --image-repo $IMAGE_REPO --dockercfgjson $DOCKERCONFIGJSON_PATH --git-host-access-token $GIT_ACCESS_TOKEN --output bootstrapresources" succeeds # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then stderr should be empty                                                                                                                                                                                                                           # shell.go:302 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldBeEmpty
After scenario
2021/08/10 13:13:43 unable to delete repository: Not Found
Before scenario

  Scenario: Execute KAM bootstrap command that overwite the custom output manifest path                                                                                                                                                                               # features/basic.feature:14
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --image-repo $IMAGE_REPO --dockercfgjson $DOCKERCONFIGJSON_PATH --git-host-access-token $GIT_ACCESS_TOKEN --output bootstrapresources --overwrite" succeeds # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then stderr should be empty                                                                                                                                                                                                                                       # shell.go:302 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldBeEmpty
After scenario
2021/08/10 13:13:53 unable to delete repository: Not Found
Before scenario

  Scenario: KAM bootstrap command should fail if any one mandatory flag --git-host-access-token is missing       # features/basic.feature:18
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL" fails # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then exitcode should not equal "0"                                                                           # shell.go:318 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldNotEqual
After scenario
2021/08/10 13:13:55 unable to delete repository: Not Found
Before scenario

  Scenario: Bringing the bootstrapped environment up                                                                                                                                                                                                                  # features/basic.feature:22
    Given gitops repository is created                                                                                                                                                                                                                                # kamsuite.go:163 -> /kamsuite.createRepository
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --image-repo $IMAGE_REPO --dockercfgjson $DOCKERCONFIGJSON_PATH --git-host-access-token $GIT_ACCESS_TOKEN --output bootstrapresources --overwrite" succeeds # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "cd bootstrapresources" succeeds                                                                                                                                                                                                                   # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git init ." succeeds                                                                                                                                                                                                                              # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git add ." succeeds                                                                                                                                                                                                                               # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git commit -m 'Initial commit.'" succeeds                                                                                                                                                                                                         # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git remote add origin $GITOPS_REPO_URL" succeeds                                                                                                                                                                                                  # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git branch -M main" succeeds                                                                                                                                                                                                                      # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git push -u origin main" succeeds                                                                                                                                                                                                                 # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "cd .." succeeds                                                                                                                                                                                                                                   # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
After scenario
2021/08/10 13:14:09 Successfully deleted repository: "https://github.com/varshab1210/gitops.git"
Before scenario

  Scenario: Bringing the deployment infrastructure up                                                                                                                                                                                                        # features/basic.feature:34
    Given gitops repository is created                                                                                                                                                                                                                       # kamsuite.go:163 -> /kamsuite.createRepository
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --image-repo $IMAGE_REPO --dockercfgjson $DOCKERCONFIGJSON_PATH --git-host-access-token $GIT_ACCESS_TOKEN --output bootstrap --overwrite" succeeds # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "cd bootstrap" succeeds                                                                                                                                                                                                                   # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git init ." succeeds                                                                                                                                                                                                                     # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git add ." succeeds                                                                                                                                                                                                                      # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git commit -m 'Initial commit.'" succeeds                                                                                                                                                                                                # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git remote add origin $GITOPS_REPO_URL" succeeds                                                                                                                                                                                         # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git branch -M main" succeeds                                                                                                                                                                                                             # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git push -u origin main" succeeds                                                                                                                                                                                                        # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "oc apply -k config/argocd/" succeeds                                                                                                                                                                                                     # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then login argocd API server                                                                                                                                                                                                                             # kamsuite.go:203 -> /kamsuite.loginArgoAPIServerLogin
    And Wait for "60" seconds                                                                                                                                                                                                                                # kamsuite.go:190 -> /kamsuite.waitForTime
    Then application "argo-app" should be in "Synced" state                                                                                                                                                                                                  # kamsuite.go:195 -> /kamsuite.applicationState
    And application "dev-app-taxi" should be in "Synced" state                                                                                                                                                                                               # kamsuite.go:195 -> /kamsuite.applicationState
    And application "dev-env" should be in "Synced" state                                                                                                                                                                                                    # kamsuite.go:195 -> /kamsuite.applicationState
    And application "stage-env" should be in "Synced" state                                                                                                                                                                                                  # kamsuite.go:195 -> /kamsuite.applicationState
    And application "cicd-app" should be in "Synced" state                                                                                                                                                                                                   # kamsuite.go:195 -> /kamsuite.applicationState
    Then executing "oc delete -k config/argocd"                                                                                                                                                                                                              # shell.go:203 -> github.com/code-ready/clicumber/testsuite.ExecuteCommand
    Then executing "cd .." succeeds                                                                                                                                                                                                                          # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
After scenario
2021/08/10 13:16:24 Successfully deleted repository: "https://github.com/varshab1210/gitops.git"
Before scenario

  Scenario: Create an Application/Service in the new Environment                                                                                                                                                                                                   # features/basic.feature:55
    Given gitops repository is created                                                                                                                                                                                                                             # kamsuite.go:163 -> /kamsuite.createRepository
    When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --image-repo $IMAGE_REPO --dockercfgjson $DOCKERCONFIGJSON_PATH --git-host-access-token $GIT_ACCESS_TOKEN --output servicescenario --overwrite" succeeds # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "cd servicescenario" succeeds                                                                                                                                                                                                                   # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git init ." succeeds                                                                                                                                                                                                                           # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git add ." succeeds                                                                                                                                                                                                                            # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git commit -m 'Initial commit.'" succeeds                                                                                                                                                                                                      # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git remote add origin $GITOPS_REPO_URL" succeeds                                                                                                                                                                                               # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git branch -M main" succeeds                                                                                                                                                                                                                   # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "git push -u origin main" succeeds                                                                                                                                                                                                              # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then executing "oc apply -k config/argocd/" succeeds                                                                                                                                                                                                           # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then login argocd API server                                                                                                                                                                                                                                   # kamsuite.go:203 -> /kamsuite.loginArgoAPIServerLogin
    And Wait for "60" seconds                                                                                                                                                                                                                                      # kamsuite.go:190 -> /kamsuite.waitForTime
    Then application "argo-app" should be in "Synced" state                                                                                                                                                                                                        # kamsuite.go:195 -> /kamsuite.applicationState
    And application "dev-app-taxi" should be in "Synced" state                                                                                                                                                                                                     # kamsuite.go:195 -> /kamsuite.applicationState
    And application "dev-env" should be in "Synced" state                                                                                                                                                                                                          # kamsuite.go:195 -> /kamsuite.applicationState
    And application "stage-env" should be in "Synced" state                                                                                                                                                                                                        # kamsuite.go:195 -> /kamsuite.applicationState
    And application "cicd-app" should be in "Synced" state                                                                                                                                                                                                         # kamsuite.go:195 -> /kamsuite.applicationState
    Then executing "cd .."                                                                                                                                                                                                                                         # shell.go:203 -> github.com/code-ready/clicumber/testsuite.ExecuteCommand
    When executing "kam environment add --env-name new-env --pipelines-folder servicescenario" succeeds                                                                                                                                                            # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then stderr should be empty                                                                                                                                                                                                                                    # shell.go:302 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldBeEmpty
    When executing "kam service add --env-name new-env --app-name app-bus --service-name bus --git-repo-url $GIT_REPO_URL --pipelines-folder servicescenario" succeeds                                                                                             # shell.go:230 -> github.com/code-ready/clicumber/testsuite.ExecuteCommandSucceedsOrFails
    Then stderr should be empty                                                                                                                                                                                                                                    # shell.go:302 -> github.com/code-ready/clicumber/testsuite.CommandReturnShouldBeEmpty
After scenario
2021/08/10 13:18:03 Successfully deleted repository: "https://github.com/varshab1210/gitops.git"
After feature

Feature: Local test
  This feature file captures local test automation.
  Due to certain technical challenges in OpenShiftCI test infra
  we are keeping test scenario in local feature file for verifying the bits locally.
  Once the CI challenges are fixed, we move these test under basic tag.

Feature: Manual test
  This feature file captures only manual test steps.
  Due to certain technical challenges in OpenShiftCI test infra
  we are keeping few test scenario in manual feature file.
  Once the challenges are fixed, we automate these manual steps too.
After suite

7 scenarios (7 passed)
60 steps (60 passed)
4m23.723375642s
ok      github.com/redhat-developer/kam/test/e2e        263.731s

@varshab1210 varshab1210 changed the title [WIP]: Create an application/service in the new environment and push configu… Create an application/service in the new environment and push configu… Aug 10, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2021
@varshab1210
Copy link
Member Author

/retest

Then executing "cd .."
When executing "kam environment add --env-name new-env --pipelines-folder servicescenario" succeeds
Then stderr should be empty
When executing "kam service add --env-name new-env --app-name app-bus --service-name bus --git-repo-url $GIT_REPO_URL --pipelines-folder servicescenario" succeeds
Copy link
Contributor

Choose a reason for hiding this comment

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

Pass https://github.com/kam-bot/bus.git instead of $GIT_REPO_URL

Copy link
Contributor

@amitkrout amitkrout left a comment

Choose a reason for hiding this comment

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

Looks like the CI cluster takes longer time to sync the application. Can you please increase timeout to 3mins, for example Wait for "180" seconds. If it works then we can increase the CI resources and also we have to implement a proper wait logic.

@@ -31,7 +31,7 @@ Feature: Basic test
Then executing "git push -u origin main" succeeds
Then executing "cd .." succeeds

Scenario: Bringing the deployment infrastructure up
Scenario: Bringing the deployment infrastructure up
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use proper indention.

@amitkrout
Copy link
Contributor

/test v4.8-integration-e2e

@varshab1210
Copy link
Member Author

varshab1210 commented Aug 11, 2021

I am able to reproduce the failure on 4.8 ocp cluster locally. @amitkrout can you please take a look?

@amitkrout
Copy link
Contributor

amitkrout commented Aug 18, 2021

blocked due to - #266

@varshab1210
Copy link
Member Author

/retest

@amitkrout
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amitkrout

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 24, 2021
@openshift-merge-robot openshift-merge-robot merged commit 4c6863c into redhat-developer:master Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement New feature or request lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants