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

Add asset generation tests #61

Open
aufi opened this issue Feb 26, 2025 · 2 comments
Open

Add asset generation tests #61

aufi opened this issue Feb 26, 2025 · 2 comments

Comments

@aufi
Copy link
Contributor

aufi commented Feb 26, 2025

There is a new asset-generation feature being added to kantra in konveyor/kantra#435

E2E test scenarios should be defined, approved, written as part of this repository.

Selected subset of those tests should be marked as TIER0 and added to upstream CI execution.

@jordigilh
Copy link

jordigilh commented Feb 28, 2025

Test 1:

(1) Run command: kantra discover cloud-foundry --input ./cf-nodejs-app.yaml --output discover.yaml
(2) Validate that the generated file contains the following content:

name: cf-nodejs
randomRoute: true
timeout: 60
buildPacks:
- docker://my-registry-a.corp/nodejs
- docker://my-registry-b.corp/dynatrace
instances: 1

(3) Run command kantra generate helm --chart-dir ./helm_sample --input discover.yaml --output-dir ./manifests
(4) Validate the generated file in ./manifests matches the expected value:

apiVersion: v1
kind: ConfigMap
metadata:
  name: cf-nodejs-config
data:
  SPACE:
  VERSION:
  RANDOM_ROUTE: true
  TIMEOUT: "60"
  BUILD_PACKS: |
    - docker://my-registry-a.corp/nodejs
    - docker://my-registry-b.corp/dynatrace
  INSTANCES: "1"

@jordigilh
Copy link

jordigilh commented Feb 28, 2025

Test 2

  • Objective:
    Test the discovery and generation of the non-K8s manifests using the kantra CLI with a helm chart that only contains non-K8s manifests.
  • Prerequisites:
    • PCF V3 application manifest with at least required fields as specified by the PCF application specification
    • Helm chart containing helm templates for non-K8s (not yaml or json format) stored inside of files/konveyor. These templates should include references to the keys in the discover manifest as generated by the kantra discover cf command.
    • Kantra CLI with support for asset generation commands for PCF V3

Steps:
(1) Run command: kantra discover cloud-foundry --input ./<name of the PCF application manifest> --output discover.yaml
(2) Validate that the generated file contains the expected output, as defined by the discover enhancement specification
(3) Run command: kantra generate helm --non-k8s-only --chart-dir <location of the helm chart> --input discover.yaml --output-dir ./manifests
(4) Validate that the generated file(s) in the ./manifests match the expected content.

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

No branches or pull requests

2 participants