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 registry index server endpoint testing #130

Merged
merged 8 commits into from
Aug 19, 2022

Conversation

michael-valdron
Copy link
Member

@michael-valdron michael-valdron commented Aug 16, 2022

Please specify the area for this PR
registry index server

What does does this PR do / why we need it:

Adds endpoint testing for registry index server, mock OCI server entity for endpoint testing which requires an OCI server, and new test registry for the endpoint testing.

Other Changes

Added starterProjectMediaType constant to registry index server server package and integration testing tests package.

Which issue(s) this PR fixes:

Fixes #?

fixes devfile/api#813

PR acceptance criteria:

  • Test (WIP)

Documentation (WIP)

How to test changes / Special notes to the reviewer:

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
commit e3b6365
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Aug 16 13:32:01 2022 -0400

    oci server spec links added to godocs in ocitest.go

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit e09a610
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Aug 16 13:13:31 2022 -0400

    godocs added to endpoint_test.go and tag error detail changed to match ResponseError.Detail type signature

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 737544b
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Aug 16 12:58:37 2022 -0400

    godocs added to ocitest.go and Detail field under ResponseError type signature changed

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 36e9223
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 29 19:01:15 2022 -0400

    TestOCIServerProxy test function and test cases added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 7163dfb
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 29 19:00:01 2022 -0400

    ProxyRecorder struct with inheritance to httptest.ResponseRecorder, ProxyRecorder adds CloseNotify receiver function from http.CloseNotifier which is needed for testing the oci proxy route and missing from httptest.ResponseRecorder

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 52d94f6
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 17:20:55 2022 -0400

    java-wildfly manifest test data and test cases under TestServeDevfileStarterProject added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit b3c4891
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 16:54:41 2022 -0400

    TestServeDevfileStarterProjectWithVersion test function and test cases added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 9cf79f8
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 16:43:09 2022 -0400

    java-quarkus manifest test data and test case under TestServeDevfileStarterProject added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit aebbedc
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 16:03:43 2022 -0400

    TestServeDevfileStarterProject test function and test cases added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit a2f464f
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 14:56:27 2022 -0400

    TestServeDevfileWithVersion test function and test cases added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 4e4749a
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 28 13:43:53 2022 -0400

    when fetching a blob, mock oci server handler now walks specified stack's directory rather than iterate through immediate children.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit a415a06
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 27 17:13:27 2022 -0400

    go-digest updated to direct dependency for digest handling in the mock OCI server.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 1742b06
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 27 17:10:52 2022 -0400

    go stack manifest testing data and TestServeDevfile test case added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit ab7505d
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 27 17:09:05 2022 -0400

    first success mock testing with OCI server, TestServeDevfile testing updated including fail case.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit c8196db
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Jul 26 18:35:16 2022 -0400

    test data for manifests added, handlers for mock OCI server progress.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 323393c
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Jul 26 18:33:54 2022 -0400

    Fixups: 'blob' corrected to 'blobs' in routes and the 'detail' field under ResponseError type changed from string to ResponseErrorDetails.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 6e0a403
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 19:43:31 2022 -0400

    added missing error logging after pullStackFromRegistry

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 044de92
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 19:14:40 2022 -0400

    mock OCI server package created.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit d4aed3d
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 15:41:52 2022 -0400

    remove unused arraylist source.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit f3af869
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 15:36:17 2022 -0400

    removed unused validateMethods function

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 6868622
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 15:35:03 2022 -0400

    writeErrors changed to use gin.H and json marshal

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 5fe00bf
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Jul 22 15:31:31 2022 -0400

    routing changed to use gin framework, ping test for mock OCI server.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit e11d9fb
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 21 18:23:47 2022 -0400

    mock OCI server routes corrected, e.g. '/v2/:name/manifests/:ref' corrected to '/v2/devfile-catalog/:name/manifests/:ref'

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit db8cb4e
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Thu Jul 21 18:21:34 2022 -0400

    TestServeDevfile test function added with base source.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit a5fc352
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Jul 19 18:38:12 2022 -0400

    mock oci server setup code added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 2978667
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Tue Jul 19 18:31:55 2022 -0400

    arraylist util functions and testing added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit eb51b6d
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 13 23:02:48 2022 -0400

    serve devfile index with type testing seperated from base serve devfile index testing.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit a62e5ff
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 13 22:50:03 2022 -0400

    endpoint function exporting reverted due to changing test source file package to the same as the endpoint functions.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 74366e7
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 13 22:46:16 2022 -0400

    setupVar fixture function added. testing for serve devfile index endpoints added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit a7e426c
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Wed Jul 13 22:44:10 2022 -0400

    test registry for index/server mock testing added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 17b0c7d
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Mon Jul 11 16:13:59 2022 -0400

    fixed up TestServeHealthCheck

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit eb6d6f8
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri May 6 17:03:38 2022 -0400

    ServeDevfileIndexV1 testing added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 38b468a
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Mon May 2 17:45:11 2022 -0400

    endpoint_test.go added:

    - Mock testing for ServeHealthCheck created
    - Base source for ServeDevfileIndexV1 with TODOs created

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit 766511a
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Mon May 2 11:32:16 2022 -0400

    endpoint handlers exported from package for use in mock testing

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

commit dfd1b91
Author: Michael Valdron <mvaldron@redhat.com>
Date:   Fri Apr 29 16:52:31 2022 -0400

    CreateIndexServer generator function added.

    Signed-off-by: Michael Valdron <mvaldron@redhat.com>

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
…eturning 404 fixed.

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
…EADME

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Copy link
Member

@johnmcollier johnmcollier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nicely done, happy to finally get some endpoint testing here 😃

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2022
@openshift-ci
Copy link

openshift-ci bot commented Aug 19, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnmcollier, michael-valdron

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2022
@michael-valdron michael-valdron merged commit e70843d into devfile:main Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
2 participants