1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
Commit Graph

46 Commits

Author SHA1 Message Date
Chitrang Patel
4af081c6a5 Created StepAction tekton-catalog-publish
Added a StepAction `tekton-catalog-publish` to assist in
publishing the StepAction catalog as a bundle.
2024-03-12 16:29:34 +00:00
Chitrang Patel
5168415df3 Add First StepAction git-clone to the catalog
This PR adds a first StepAction `git-clone` to the
catalog. It is based off the Task but with samples and
tests updated.
2024-03-08 13:39:32 +00:00
vinamra28
1dfd21c4b8 Add logger to identify the pod failure 2023-09-27 12:52:25 +01:00
vinamra28
abba6b845e Skip the installation check for deprecated tasks
Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2023-09-27 12:52:25 +01:00
vinamra28
c9e1416fed Bump pipelines to v0.51.0
E2E tests were running an older version of pipelines ie v0.45.0.
Bumping it to use the latest version v0.51.0 so that current tasks in
catalog can be tested against latest version

Also remove pipelineresources check while doing installation of latest
version of pipelines

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2023-09-27 12:52:25 +01:00
Yulia Gaponenko
cab0b76389 Extend catalog test script to run test for different platforms
PLATFORM env variable is introduced. This variable allows to run
tests for specific platform (for insance, "linux/s390x" or "linux/ppc64le").
If the environment variable is specified
- some tests are updated with different image values/other parameter
values, required for specific platform, using yq tool.
Custom values should be specified in the script file, separate for each
platform. In the current code script file for linux/s390x is proposed.
- only tasks, which have mention about corresponding platform support
in the annotation, will be tested.
If PLATFORM env variale is no specified, the behaviour of test scripts
will be similar to the one before the PR.

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
2021-11-12 04:38:42 +00:00
Yulia Gaponenko
3b9cd7c6b1 Use multi-arch go-rest-api-test image
The image is used in many catalog tests. To run the tests on many
platforms, the image should be the multi-arch one (at this moment -
linux/amd64, linux/ppc64le, linux/s390x, linux/arm64).

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
2021-09-29 14:06:28 +01:00
Haibing Zhou
4bf19372b7 test/e2e: handle fixtures configmap volume correctly
When adding `fixtures` volume, we need to consider whether the task
already has a volumes section. If the volumes is already defined, then
we should add `fixtures` rather than replacing the whole volumes.
2021-09-01 07:06:14 +01:00
Piyush Garg
c2547bd722 Refactor in e2e script and pre-apply func
Created a function to run secure sidecar registry with cert
and calling that function from all tests to remove duplication
2021-04-08 14:19:48 +01:00
vinamra28
5a36143b2e Append volumes in sidecar instead of podTemplate for fixture
In e2e tests script podTemplate was getting added even if the yaml
manifest contains only ConfigMap which was failing the CI.

Append volumes in sidecar to mount fixtures ConfigMap instead of using podTemplate
as appending the podTemplate was conditional and there can be scenarios
where podTemplate might get appended at wrong location.

Signed-off-by: vinamra28 <vinjain@redhat.com>
2021-04-06 11:45:48 +01:00
06kellyjac
442e379fd6 Go back to appending sidecars with python
- Check for libraries in a pip agnostic way
- allow for adding multiple sidecars with a reusable `add_sidecars` function
- fix overwriting sidecars issue for previous python
- make it more readable
2021-04-01 13:23:46 +01:00
Andrea Frittoli
67fde32738 Support response files in fixtures
Extend to test logic to be able to load the fixture reponse from a
file, so that we don't have to inline a long JSON doc into the fixture
config YAML. This is achieved by creating a config map with all the
files in the fixtures folder, and mounting that configmap as a volume
to the sidecar.

This allows improving the test for the github-add-comment task v0.4

Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
2021-03-29 09:41:45 +01:00
06kellyjac
19d23ef044 Add sidecar using sed and remove python
Also check kubectl cmd installed
2021-03-11 16:53:48 +00:00
vinamra28
3911a649a3 Skip the validation of YAML if task is removed
If a task is being removed from the catalog then also the CI runs the
check for validating the YAML and thus fails if the task manifest is not
found.

This PR checks for the task directory whether it exists or not and in the case
where task directory is not present then the function doesn't checks the
validation of the YAML. Example if we remove the task knctl-deploy then
the CI would skip the check for that pull request.

Signed-off-by: vinamra28 <vinjain@redhat.com>
2021-01-21 10:22:39 +00:00
Javier Romero
fb9c087d5c Add dependency checks to e2e test script
Signed-off-by: Javier Romero <rjavier@vmware.com>
2021-01-06 15:48:11 +00:00
Chmouel Boudjnah
4fde958a33 Allow redefining KUBECONFIG command
In some case we want to be able to redefine the KUBECONFIG commands, when other
CI needs to redefines it.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-12-08 08:51:35 +00:00
Chmouel Boudjnah
8c986c2e74 Add parallelisation of tests
We were running previously the tests sequentially,

Since the catalogs tests are growing exponentially, let's add parallelization to
speed things up.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-12-08 08:51:35 +00:00
vinamra28
c480135d95 Fix e2e scripts to test modified tasks
Current e2e script is only able to run integration tests on those PRs which include tests.
With this fix, tests will run on those PRs also in which only task yaml is changed

Signed-off-by: vinamra28 <vinjain@redhat.com>
2020-11-23 10:36:30 +00:00
vinamra28
11a17cfe87 Add security context in create step of buildpacks
Signed-off-by: vinamra28 <vinjain@redhat.com>
2020-11-19 15:58:28 +00:00
Chmouel Boudjnah
7b49793238 Fix add_task common function
We were not getting properly the versions when there was files like OWNER in there

so make sure to grab only the directory

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-30 13:44:21 +00:00
Chmouel Boudjnah
9a3c2ef648 Make sure we ar enot quoting $@
And detect properly the changed files when we have multiple yaml files in dir.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-29 16:24:21 +00:00
Chmouel Boudjnah
5412a08cfc Test only the tasks that has been modified or added
We are detecting the task that only has been modified or added with the help of
git diff against the 'main' branch.

If we set and define the variable TEST_RUN_ALL_TESTS it will force running all
the tests and not just the modified ones.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-28 17:35:21 +00:00
Chmouel Boudjnah
95006e48b4 Improve e2e tests runner output
We temporary disable the debug output while on the loop so we don't have the
gazillions debug messages while digging into the log. We have added the 'timing'
when it start and ends so we can easily spots the very slow test.

Aditionally we have introduced the new variable `CATALOG_TEST_SKIP_CLEANUP` if
set it will skip deleting the namespace. This is useful when running in
conjuncton with the `./test/run-test.sh` script to debug when there is a failure.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-26 11:24:20 +00:00
Chmouel Boudjnah
73b9b12e53 Add add_task helper function for tests
We were previously using the outdated git_clone version 0.1 in the
add_git_clone_task function.

So let's introduce a more generic function :

```
add_task ${task} ${version}
```

if version is 'latest' it will always install the latest version of the task.

Change all pre-apply-task-hook to use that function instead.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-07 17:51:55 +01:00
Chmouel Boudjnah
b9383b4936 Add support for REST services testing
Add support for REST services testing, if we have a directory in the tests
directory called `fixtures` with a yaml file that contains a responder
rules (see github-add-comments task example) it will add a sidecar task from
https://github.com/chmouel/go-rest-api-test/ so the test can point to it.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-10-06 17:03:54 +01:00
Chmouel Boudjnah
9aa07d4adf Use the proper path for the last release.yaml
previous link https://storage.googleapis.com/tekton-releases/latest/release.yaml would install 0.10.0
2020-09-01 19:12:13 +01:00
popcor255
58900d2a75 use default yaml release using google apis instead of querying github api
This line queries twice to the github api in order to apply the tekton release yaml. It would increase readability if we just use the googleapi to fetch the yaml.
2020-09-01 10:08:12 +01:00
vinamra28
015142c05f Fix CI issues
CI was not able to monitor some pipelineruns for tasks in catalog example maven task and was getting "Could not find a created taskrun or pipelinerun in maven-0-1+ breakit=True" which is not the expected behaviour so with this patch we will iterate over it 5 times and check for it's status and reason

Signed-off-by: vinamra28 <vinjain@redhat.com>
2020-08-17 17:17:08 +01:00
Piyush Garg
b895a44bba Refactor namespace name to have version
This will refactor the namespace name to have version of task
in namespace name as current logic may create issue in case
of multiple versions running in same namespace as pid will
remain same
2020-08-03 10:25:03 +01:00
Chmouel Boudjnah
bddd282012 Centralize all the git-clone apply task to a common function
Centralize all the the git-clone apply commands we had around the
pre-apply-task-hook to a central common function.

This will make easier to have the same git-clone task version used everywhere.

Add some documentation about the helper functions along the way.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-07-24 15:00:01 +01:00
Piyush Garg
e83bc62494 Refactor sidecar script
This will refactor sidecar script to read it in
a better way to avoid unicode error
2020-07-22 07:58:00 +01:00
Piyush Garg
299b352d75 Use python3 2020-07-21 11:20:00 +01:00
Piyush Garg
7a474eac65 Fix warning for yaml.Load function 2020-07-16 18:35:59 +01:00
Piyush Garg
479c6d967b Update e2e scipts according to new structure
This will update the e2e scripts to run tests according to
new catalog structure after reorg

Fix #420
2020-07-16 18:35:59 +01:00
Chmouel Boudjnah
b79765dbbd test-runner: Do not show logs on success
This can grow the log pretty big with message that not a lot of people will care
about.

when we show the logs on failure, make sure we are not failing if we can't show
them. Sometime some container may be in "Terminated" state until k8 cleans them
up. (i.e: affinity-assistant) so no need to worry if those are failing/exiting before
showing the next container log.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-06-23 15:06:59 +01:00
Dibyo Mukherjee
903370fd9f Wait until all TaskRuns are complete to print logs
The loop in the test runner script that was waiting for all TaskRuns to
complete had a bug where it would break out of the loop as soon as any one of
the TaskRuns completed. The test runner then tries to print the logs for all
TaskRuns (which includes some Running ones) which will sometimes fail e.g. if
the TaskRun's pod is in a PodInitializing state.

Fixes #379

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
2020-06-22 23:06:58 +01:00
Chmouel Boudjnah
6b7cf32a82 Make sure we skip the test if there is no yaml file in there
Test would be failing if there is a directory but no yaml template in there,
which in reality we should not have this happening but it happens sometime.

let's make sure we skip the test if there is no yaml files then.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-06-04 09:56:51 +01:00
Scott
67612fa4f6 Give test Runs time to appear in kubectl get lists
Immediately after our test runner submits test TaskRuns / PipelineRuns
it checks that those Runs appear in `kubectl get` output. In a recent
PR to add a kythe-go Task (#301) the test runner would fail at this
point. Checking locally I was able to reproduce the issue. It looks
like it can take a small amount of time for submitted resources to
show up in `kubectl get` output.

For other types of test failures the test runner gives a grace period of
up to ten minutes. I did the same for the `kubectl get` check, allowing
the test run loop to run again in ten seconds if nothing appears in a
taskrun / pipelinerun list. Making that change resulted in the kythe-go
test proceeding normally and passing.

This commit updates the test runner to repeatedly check whether
TaskRuns / PipelineRuns have appeared in the `kubectl get` output.
2020-05-07 10:06:36 +01:00
Chmouel Boudjnah
f86cb987b4 Allow multiple tests on each tasks
We were checking only one test previously, let allow multiple test in task

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-04-16 15:03:04 +01:00
Chmouel Boudjnah
22e0507eef Handle TaskRun as well as PipelineRun tests
Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2020-04-08 23:15:01 +01:00
Vincent Demeester
a648e990dd Use PipelineRun instead of TaskRun in e2e 📎
Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2020-03-11 07:43:48 -05:00
Vincent Demeester
54b250dc32 Add more *dump* information in case of failure 🦆
Output Tasks, Pipeline, PipelineRun and TaskRun.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2020-03-11 07:43:48 -05:00
Chmouel Boudjnah
a642294878 Catalog tests should not be looping in case of failures
We are currently looping forever without any safe counter, let's just do that,

Refactoring a bit so we reuse a common function for that,

Closes #156

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2019-12-03 03:41:38 -06:00
Chmouel Boudjnah
c9bd921943 [E2E] Add common function when we are adding a registry to tasks
Closes #145

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2019-11-27 04:09:35 -06:00
Chmouel Boudjnah
c2dd526fe5 Refactor the test functions
- Move test functiosn to e2e-common
- Remove old serviceaccount things
- Allow override functions (or add) like the way we do with plumbing
functions (for downstream CIs)

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
2019-11-18 11:25:33 -06:00
Piyush Garg
608f6fd06d Refactor e2e test
This will add create install pipeline CRD
function which can accept release yaml or
install latest
2019-11-15 12:02:32 -06:00