Commit Graph

15 Commits

Author SHA1 Message Date
Matej Vašek 70f96bb8ac
Fix some linter errors in integration tests (#2608)
* Fix some linter errors

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* fixup: set func registry

Signed-off-by: Matej Vašek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-12-04 13:36:45 +00:00
David Fridrich ca61712d4b
allow digested images to be 'run' (#2445)
* init fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* dont override direct deploy tag, more tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* dont validate with tagged image, fix comment

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* init run fix for --image

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* init

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* int test, add valid untdigested images to run

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* check images passed to runner for func run command

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix build/deploy image passing bug add test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove extra printing

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* merge functions to digested

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* misspell

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* simplify

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

* quick fix

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

* remove prints, comment

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
2024-08-28 06:13:02 +00:00
Matej Vašek a2a97dbd85
Fix linter issues (#2420)
* chore: fixed typos

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* chore: removed trailing whitespaces

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* chore: added EoLs at EoFs

Signed-off-by: Matej Vašek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-07-09 13:48:22 +00:00
Matej Vašek 9f7eac80ce
test: better res cleanup (#2349)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-12 16:01:03 +00:00
David Fridrich aa909bdc44
Run func without HOME defined/ unaccessible .config dir (#2236)
* fixed integration tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* def creds back

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* docker config.json credentials test when HOME not defined

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* pack test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* simplify

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* og creds, small fixes

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* s2i test no home

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove unnecessary stuff

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* deploy test without home

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* confict fix after rebase

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* move test, dont delete

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* runtime change

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* node image signals fixed and smaller size for GH actions

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* return err

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* cred test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* clean up comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2024-06-04 00:04:52 +00:00
Luke Kingland e6fa020f78
fix: test and namespace isolation (#2187)
* fix: namespace logic cleanup and test isolation

- Pulls logic for defaulting to active namespace (K8S) moved UP to CLI during
  flag default calculation.
- Pushes logic of deciding between f.Namespace vs f.Deploy.Namespace down into
  implementations.
- Updates some tests which needed to have their environment cleared.
- Refactors Pipelines tests to use client API.
- Removes namespaces as a state variable all structures, instead passing as
  an argument.
- Moves FromTempDirectory to testing package for use outside cmd.

* fix spelling errors

* fix: pipelines remover always returned (empty) error

* update tekton namespace handling

* fix: remove deprecated GitLab config: max_concurrency
2024-05-17 08:25:46 +00:00
Luke Kingland e4010db028
src: cleanup setup scripts (#2247)
The current binaries and allocation scrips are very CI-centric, this PR
takes a few steps to make them more friendly to running in a dev
environment; mainly centered around not polluting global scope (keeping
filesystem mutations in a relative local directory).

- binaries (and kind kubeconfig) are installed in ./hack/bin
- adds /hack/bin to .gitignore
- binary paths can be overridden via env vars FUNC_TEST_{name}
- binary fallback is system-installed (when binaries.sh not run)
- Cleanup of the UX, including colors and some shared helpers via
  library.sh
- Removes `yq` as the hack that required it appears to no longer be necessary.
- Adds some notes for Nix users
- Better error messaging when !linux
- Refactors the installers to pipe directly to tar rather than touch
  disk.
- begin to standardize on hyphens in filenames
2024-04-02 08:29:03 +00:00
David Fridrich 7e95ca2181
Cleanup orphaned func, new image-name calculation (#1962)
* forced namespace change, deletes old func, kind works

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new .deploy.image field

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* building

* building

* add first iteration of complete functionality with f.Build.Image and f.Deploy.Image that STILL contains a workaround for image digest which is populated on Push instead of Build

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* base tests fixes for compile

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix base tests2 for now, integration test has a possible TODO

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new generated schema

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix some tests using .Image and create new test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove nested .func

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* get rid of test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove my debug test

* fix namespace change test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix pipeline run to use .Deploy.Image

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix TestDeploy_ConfigApplied and change pipelines image being used

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix some tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix actions - return value, configApplied and registry on subsequent deploy different

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* update empty image in tests issue

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix client.Apply tests with passing image value to .Deploy after push

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* openshift override on namespace change forced, remove useless print

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* printing fixes, reviewdog, buildConfig return

* fix pipelines test by feeding image name to .Deploy, comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* update more tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new test, comment

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* misspell

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove unnecessary comments

* fix from review

* namespace updated with 2 fields; new error definitions; deploy functionality cleanup

* remove k8s service host var in test

* error definition; fix client tests; cli delete fixup

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new schema

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* namespace fixes; remover arguments fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* delete_test cmd

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* schema, new local remote flag instead of deploy

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix test to have now required namespace

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* add namespace check, test action

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix integration deploy test, comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix wrongly removed namespace

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* small changes to remover and ns added to its tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* test moving logic to client

* fix deploy bug, remove verbose for better logs

* pipelines, clean remover

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* newline

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* namespace required in remover, and fixed remote deployer - returns ns

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix integ test for pipelines.Run

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* cleanup

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* registry update change on deploy, some prints

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new deploy tests and mock update

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new tests, ns determination in mocks

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* deploy digested img doesnt populate build

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove todo

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2024-02-27 10:44:20 +00:00
Matthias Wessendorf 5bb373ab2c
Adding support for `func subscribe` for creating mutiple triggers, based on event filters (#2001)
* Adding support for `func subscribe` for creating mutiple triggers, based on event filters

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* Update cmd/subscribe.go

Co-authored-by: Luke Kingland <luke@lukekingland.com>

* removing unused import

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* running make

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Some import ogranization

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Change argument syntax

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* changes

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Adding some emoji text

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* 💄 move subscriptions underneath the deploy element

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* adding silly emoji to build

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Adding some simple/copied/modified test

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Running 'make schema-generate'

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Update function

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Little unit test

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Adding a bit more help text

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* misspell instruction

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

---------

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Co-authored-by: Luke Kingland <luke@lukekingland.com>
2023-11-06 13:56:38 +00:00
Matej Vasek b24688723e
test: more robust test (#2041)
The test service does serveral retries instead of just one http GET.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-10-20 17:22:57 +00:00
Jefferson Ramos 3641bfe5d0
test improvements remove deprecates avoid nils, bump go version 1.20.x (#2032)
* test: improvements on e2e extended test: remove deprecates, avoid nils and improve match conditions

* update go version on ci to 1.20.x
2023-10-18 17:28:26 +00:00
Luke Kingland 89b599df24
feat: job scaffolding (#1697)
* feat: job scaffolding

- Local jobs use a directory rather than filename
  This sets up for upcoming scaffolding to use as a space for job
  scaffolding code.
- Places all jobs within a 'runs' directory in ./func rather than
  'instances' to further differentiate between an instance and a local
  run task invoked via .Run
- Updates Jobs' stop handler to have an error return.
- Adds tests which ensure creating and stopping a job are reflected in
  the client's .Instances().Local() accessor.
- Adds verbose logging support to the Job implementation.
- Adds a cleanup task which will remove orphaned jobs by, in addition to
  previous logic, checking that there is no longer a process listening
  on the port indicated by the job.

* fix spelling errors

* fix lint errors

* log job stop errors

* use temp dir for tests

* add back docker build tags and wait
2023-05-04 20:53:57 +00:00
Manoel Marques 1ce5d2b7c3
Replace path with function struct in client api (#1640) 2023-03-31 00:45:00 +00:00
Zbynek Roubalik 726b566f83
fix: deploy annotations & labels correctly (#1574)
* fix: deploy annotations & labels correctly

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* increase timeout

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

---------

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-21 15:24:26 +00:00
Zbynek Roubalik 5a4803bf95
chore: refactor repository layout (#1554)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-15 08:46:52 +00:00