Skip to content

Commit

Permalink
SRVKP-6191 new basic test for http resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
jayesh-garg committed Sep 26, 2024
1 parent 6e72a72 commit 3f6b6a0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 2 deletions.
22 changes: 22 additions & 0 deletions specs/pipelines/http-resolvers.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PIPELINES-31
# http resolvers spec

Pre condition:
* Validate Operator should be installed
## Test the functionality of http resolvers: PIPELINES-31-TC01
Tags: e2e, sanity
Component: Resolvers
Level: Integration
Type: Functional
Importance: High

Steps:
* Verify ServiceAccount "pipeline" exist
* Create
|S.NO|resource_dir |
|----|-----------------------------------------------------------------|
|1 |testdata/resolvers/pipelineruns/http-resolver-pipelinerun.yaml |
* Verify pipelinerun
|S.NO|pipeline_run_name |status |check_label_propagation |
|----|-----------------------------------|--------------------------------------|
|1 |http-resolver-pipelinerun |successful |no |
5 changes: 3 additions & 2 deletions tc_spec_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"PIPELINES-25": "specs/pipelines/bundles-resolvers.spec",
"PIPELINES-26": "specs/results/results.spec",
"PIPELINES-27": "specs/chains/chains.spec",
"PIPELINES-28": "specs/operator/manual-approval-gate.spec"
}
"PIPELINES-28": "specs/operator/manual-approval-gate.spec",
"PIPELINES-31": "specs/pipelines/http-resolvers.spec"
}
12 changes: 12 additions & 0 deletions testdata/resolvers/pipelineruns/http-resolver-pipelinerun.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: http-resolver-pipelinerun
spec:
pipelineRef:
name: http-resolver-pipeline
params:
- name: url
value: "https://example.com"
- name: method
value: "GET"
19 changes: 19 additions & 0 deletions testdata/resolvers/pipelines/http-resolver-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: http-resolver-pipeline
spec:
params:
- name: url
description: URL to resolve
- name: method
default: "GET"
tasks:
- name: resolve-http
taskRef:
name: http-resolver-task
params:
- name: url
value: $(params.url)
- name: method
value: $(params.method)
18 changes: 18 additions & 0 deletions testdata/resolvers/tasks/http-resolver-task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: http-resolver-task
spec:
params:
- name: url
type: string
- name: method
type: string
default: "GET"
steps:
- name: http-request
image: curlimages/curl:latest
script: |
#!/bin/sh
curl -X $(params.method)
$(params.url)

0 comments on commit 3f6b6a0

Please sign in to comment.