Commit Graph

69 Commits

Author SHA1 Message Date
Jefferson Ramos 2a273c98ee
test: adding e2e github oncluster test scenario (#1649) 2023-03-30 22:25:00 +00:00
Jefferson Ramos 9d00af158b
e2e tests restructuring / refactoring (#1615) 2023-03-16 20:52:59 +00:00
Matej Vasek 9a9da1ff3f
chore: coverage for e2e tests (#1603)
* chore: coverage for e2e tests

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: disable thread sanitiser

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-08 17:53:20 +00:00
Matej Vasek 1cff3a4d35
chore: clean up e2e project update logic (#1593)
* chore: clean up e2e project update logic

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: linter unused param

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-02 19:14:31 +00:00
Matej Vasek 6d4565158b
feat: enabled s2i for python (#1562)
* feat: enable s2i for python

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: update zz_filesystem_generated.go

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: test

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: test

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: test

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: script

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-02-20 16:45: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
Jefferson Ramos e6618c0c2b
test: e2e on cluster test in verbose mode (#1537) 2023-02-14 17:14:51 +00:00
my-git9 705cbcd8ac
Cleanup: remove ioutil for new go version (#1532) 2023-02-06 09:43:35 +00:00
Luke Kingland 0f5b93fa96
e2e tests log stdout and stderr (#1524)
* fix: e2e tests logs on error

Commands now print stdout buffer on failure.  In particular, they now
print the stdout buffer, the stderr buffer, and the final returned error text.

* use combined output throughout oncluster tests

* e2e set TestInvoke verbosity on
2023-01-27 10:11:41 +00:00
Luke Kingland 554e74a309
chore: remove underscore prefix from test packages (#1503)
* remove underscore prefix from test packages

* springboot patch attempt
2023-01-20 09:01:02 +00:00
Jefferson Ramos 3ebed33fda
test: cleanup e2e on cluster tests and make default test registry dynamic (#1474) 2022-12-16 21:11:51 +00:00
knative-automation 5d67de768b
Format go code (#1407)
Signed-off-by: Knative Automation <automation@knative.team>

Signed-off-by: Knative Automation <automation@knative.team>
2022-11-04 11:11:04 +00:00
Jefferson Ramos f5470c009c
test: adding oncluster builds e2e tests for s2i supported runtimes (#1235)
* test: adding oncluster builds e2e tests for s2i supported runtimes

* fix: s2i tekton task with empty build envs
2022-10-20 08:29:12 +00:00
Matej Vasek d536b799f2
On cluster build without VCS (#1298)
* refactor: attach() and podReady() more general

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* feat: added function for upload to a volume

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* refactor: extract defaultSecurityContext

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix: added runtime type check

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* feat: allow on-cluster-build without VCS

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix: reword error message

Co-authored-by: Lance Ball <lball@redhat.com>

* fix: runtime type check

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* test: e2e test for direct upload on-cluster-build

Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Lance Ball <lball@redhat.com>
2022-10-17 19:52:11 +00:00
Jefferson Ramos c740b11095
fix: use proper tmp dir for oncluster e2e tests (#1346) 2022-10-17 11:51:57 +00:00
Matej Vasek ee49339bc4
fix: use proper temp dir for funs in e2e tests (#1345)
Signed-off-by: Matej Vasek <mvasek@redhat.com>

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-10-17 10:51:57 +00:00
Lance Ball 5adec03c7b
chore: update all references to kn-plugin-func (#1311)
* chore: update all references to kn-plugin-func

I did not change references in CHANGELOG.md but otherwise, I believe
this should cover all configuration settings, image names, package
names, etc.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix instances_test.go

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: still some stray kn-plugin-func

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-10-13 16:31:53 +00:00
Gabriel Freites 9c3118a54e
Func unit testing first approach (#1312)
* fixed typos on test readme.md

* added my first unit tests to func repo builder errors
2022-10-12 04:41:51 +00:00
David Simansky e0bbcc2d08
chore: Refactor use of deprecated io/ioutil package (#1285) 2022-09-27 13:28:15 +00:00
salaboy fe0368a793
[feat] refactoring func.yaml struct to match cmd lifecycle (#1254)
* rebased and updated func struct

* fixing migration to 1.0.0 struct

* fixing on cluster tests

* updaating migration version to 0.34.0

* adding tests for marshalling and migration errors

* adding EOF new line

* updating migrations

* fixing wrong name

* fixing marshalling test

* adding EOF line

* fixing assertion
2022-09-22 20:22:12 +00:00
Luke Kingland 15713b2a75
feat!: deploy autobuild and flag persistence (#1079)
* feat: deploy autobuild and flag persistence

* cleanup

* help text, comments and test cleanup

* removing usurped commands.txt

* add platform to deploy synopsis help
2022-09-14 11:45:10 +00:00
Zbynek Roubalik 1ed5b2d5fd
chore: install Tekton Task from local source code & install S2I task (#1234)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-09-13 01:07:47 +00:00
Luke Kingland 645990203d
invoke: pack and go are known compatible (#1219) 2022-09-06 22:42:18 +00:00
Jefferson Ramos 4041d609dd
test: oncluster build initial e2e set of tests (#1193) 2022-09-05 13:08:22 +00:00
Luke Kingland e6ec11b0e5
builder short name constants etc throughout (#1180)
* chore: shared builder constants etc

* pretty-print the shared unknown builder error

* update builder impls to use shared defs and validators

* error and docs text formatting

* include static default short names

* comment updates and typos

* docs paths

* use the constants for the in-package builder defaults

* use builders.All but with caviat
2022-08-24 19:34:18 +00:00
Jefferson Ramos 3af2ea3490
test: quarkus test template change to remove package type property (#1171) 2022-08-17 18:08:48 +00:00
Lance Ball 3b8c24092b
fix: use space prefix for deploy output text (#1144)
* chore: use space prefix for deploy output text

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/1138

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust e2e deploy test expectations

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: another e2e test tweak

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: another e2e test tweak

Signed-off-by: Lance Ball <lball@redhat.com>
2022-08-02 13:11:16 +00:00
David Fridrich e659256005
chore: use lower case *functions* in all CLI outputs (#1135)
* first run, F -> f

* fix

* fix

* misspells

* client*.go files

* add client*.go: misspells

* cmd dir test files

* docker dir

* function* files

* i*.go and job.go

* job.go,mock dir,repos*,s2i dir,schema dir,templates*

* test dir

* testing dir

* root dir *.go second round
2022-07-27 13:34:36 +00:00
Jefferson Ramos ff20f53671
test: remove verbose from test invoke create/deploy commands (#1137) 2022-07-21 16:18:24 +00:00
Lance Ball cccb2833d1
chore(deps): update node/typescript deps in e2e tests (#1119)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-07-18 12:37:59 +00:00
Gunjan Vyas afd224fe5c
feat: deploy success message also displays the namespace (#1090)
* func deploy should display namespace

* Modified e2e to consider namespace

* Added Namespace field in DeploymentResult struct

* Modified unit test for client deploy

* e2e fix
2022-07-06 16:34:08 +00:00
Jefferson Ramos 81091863e7
test: explicit define builder for e2e tests tied to golang as test remote repo, config and envs (#1081) 2022-06-29 13:35:30 +00:00
Daniel 5f8c01829e
feat: introduce echo return for Python http template (#1078)
* Introduce echo return for Python http template

* Updated tests and regenerated zz* file

* Updated output to dict-only

* Changed output type from Python dict literal to proper JSON
2022-06-28 16:21:30 +00:00
Matheus Cruz f828b0998c
feat: add echo for springboot http template (#1072)
* feat: add echo func

* chore: package

* docs: update docs

* refactor: add space between headers

* refactor: regenerate zz file

* refactor: clean with pre-commit

* refactor: add func_yaml-schema.json file

* refactor: rename test and fix white-spaces

* refactor: remove .idea files

* test: change http test

* test: change expected result
2022-06-17 17:05:18 +00:00
Luke Kingland 7a60394be6
feat: add all build flags to deploy (#1065)
* spelling

* feat: full build options on deploy

* increase e2e lifecycle test timeout to 45m

* remove redundant flag shorthand b

* map flags for parsing
2022-06-16 16:02:17 +00:00
Luke Kingland 867d4c26d6
feat: improved invoke verbosity (#1007)
* feat: improved invoke verbosity

* e2e test updates

* regen filesystem

* e2e tests: add to query what is expected as an echo
2022-05-11 19:16:35 +00:00
Jefferson Ramos 9396f7bd07
test: update python e2e tests (new revision test) (#983) 2022-04-20 12:03:29 +00:00
Jefferson Ramos 01f113969a
CI enhancements (e2e tests) and Go template fix (#970)
* Adding timeout and additional logs on e2e http test

* Better revision check on e2e http update test

* ci: Adding workflow to run e2e for all runtimes

* fix: server error 500 for Go cloudevents template
2022-04-19 14:18:28 +00:00
Jefferson Ramos f92db575e9
Update Springboot and quarkus e2e tests (#959) 2022-04-12 13:30:09 +00:00
Luke Kingland a91bcc5fcf
feat: s2i builder with preliminary node support (#923)
* fix: stuck build ticker

* feat: s2i builder prototype

* default builders

* use s2i fork with updated docker

* in-code builder defaults

* s2i builder verbosity constructor arg

* typed errors

* typed error tests

* remove unneeded env code

* s2i build e2e test

* e2e tests

* update licenses

* cleanup

* codegen debug

* update licenses

* Revert "Update actions (#921)"

This reverts commit 8312b5c560.

* update licenses

* e2e test updates

* use GetDefaultDockerConfig for s2i config

* docker.NewClient docs
2022-04-05 13:08:44 +00:00
Jefferson Ramos 8702515d91
test: url for invoke test (#863) 2022-02-24 02:32:38 -08:00
Lance Ball c58fcb7a9f
chore: skip integration tests for now (#780)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-25 07:16:49 -08:00
Luke Kingland e918f74b9e
feat!: invoke (#705)
* feat!: rename 'emit' to 'invoke' and default to local

This commit renames 'func emit' command to 'func invoke' and makes the
default behavior to send an event to localhost. The special '--sink'
value 'local' is changed to 'cluster' to indicate that the function
should be invoked on the cluster instead of locally. All other behavior
has remained the same.

BREAKING CHANGE

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update commands.md doc

Signed-off-by: Lance Ball <lball@redhat.com>

* squash: change Emitter interface to Invoker

Changes Emit() to Send() in the (now named) Invoker interface, and changes
Emit() to Invoke() in the client.

BREAKING CHANGE

Signed-off-by: Lance Ball <lball@redhat.com>

* squash: use a common Invoker interface for HTTP and events

Signed-off-by: Lance Ball <lball@redhat.com>

* checkpoint

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: change Emitter to EventInvoker

Signed-off-by: Lance Ball <lball@redhat.com>

* Invoke v2 Draft

* feat: client invoke function

* static invoke defaults and methods

* remove assimilated invoker package

* includes an ignored .func directory on create

* Instances manager with local and remote defaults

Funciton Info is now Instance, representing a Function in a given
environment.

Describing a Function instance is now Instances().Get(f, environment)

Moves Runner to be async with a Stop method to enable returning runtime pid
and port for persisting.

Instances now have a place for primary Route in addition to all routes slice

Running Functions write PID and Port to .func

* cascading targets: local vs remote vs ad-hoc endpoint

* runner start signals and cancel cleanup

* return run on context done or err on channel

* async runner

Refactors the image runner to start the container asynchronously,
reporting back the port on which it started.  Errors are communicated
back via a provided channel and stop is signaled using context
cancelation.

* pid neither required nor available

* add withTransport option

Incorporates addition of custom transport of the emitter into the
renamed version invoker. Flag and help text cleanup.  Re-additionof the
Info accessor.

* schema now includes invocation data

* loop build msg

* run jobs

Externally exposed port is now chosen based on availability, with 8080
preferred and falling back to an os-chosen open port.
The Client Run method is now async, returning the port assigned to the
running Function, a stop/cleanup function and a runtime errors channel.
The Runner is internally divided into the runner and its started Jobs.

* job metadata

Extracts job metadata tracking to a Job object in the core,
Handles multiple instances of the same Function by creating a single
file for each instances in .func/instances/<port>

* remove superfluous error types and flag bindings

* feat: enable invoke target remote

* feat: preferentially invoke local, remote if running

* feat: read --file for invoke

* feat: invoke confirm prompts

* fixup cli tests

- Updates to handle asynchronous Runner
- Standardize on the naming convention for selective running

* docker runner tests and lint errors

* test refactor

* feat: invoke format override

* comments, spelling and other cleanup

* invoke command doc

* feat: invoke format interactive option

* rename runjob.go to job.go

* e2e test flag update

* test naming homoginization

* silence build activity messages when verbose

* test debugging

* code review updates

- return Job from Client.Run rather than constituent members
- Treat .gitignore as contentious, punting on feature to mutate if
  extant.
- docs wording changes
- add invocation format to pertinent manifest.yaml files

* help text spelling etc.

Co-authored-by: Lance Ball <lball@redhat.com>
2022-01-21 12:04:05 -08:00
Zbynek Roubalik cb719ff564
feat!: support on cluster build from git repo with Tekton (#743)
* feat: support on cluster build from git repo with Tekton

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback 2

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* fixup-licence

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix deploy with --build=disabled

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

Co-authored-by: Matej Vasek <mvasek@redhat.com>
2022-01-12 11:58:51 -08:00
Lance Ball 963659bd0b
chore: add knative infra release scripts (#729)
* chore: add knative infra release scripts

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add newlines at EOF

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-12 06:49:51 -08:00
Matej Vasek 07062c144a
fix: revert hostname alias (#712)
The localhost alias was causing problems with new approach for registry access.
The new access is done directly not via daemon.
This renders any insecure registry exception in daemon config irrelevant.
The library facilitating registry access seems to allow insecure registry on localhost only.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-12-08 18:38:34 -08:00
Luke Kingland f63af0d34e
fix: move integration port to unregistered range (#701)
* fix: move registry port to unregistered range

Moves the integration testing port into the unregistered range (above
49151) to minimized potential conflicts.

* update e2e and podman with named registry
2021-12-07 15:05:38 -08:00
Lance Ball 4b3a5c32df
chore: revert using a fork of boson-project/test-templates (#687)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-11-29 21:51:08 -08:00
Lance Ball e4831da4d4
chore: remove dead code (#561)
* chore: remove dead code

The default builders configured in builder.go were not only wrong, but
also not even used anymore. Removing them...

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix failing e2e tests

Signed-off-by: Lance Ball <lball@redhat.com>
2021-11-23 11:29:50 -08:00
jrangelramos d1b322fe82
test: add e2e test for config volumes (#612) 2021-11-03 05:40:47 -07:00