-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First part of Hub REST API test suite. Steps - the simplest CRUD for all resource types - simple seeds tests - connecting resources with refs (update tests above) - clarify non-trivial fixtures definition and tear up&down - basic integration scenarios (addons&analysis) Related to #262 --------- Signed-off-by: Marek Aufart <[email protected]>
- Loading branch information
Showing
49 changed files
with
2,765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Test nightly | ||
|
||
on: | ||
schedule: | ||
- cron: '13 0,12 * * *' # Regulary every 12 hours | ||
|
||
jobs: | ||
test-integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Start minikube | ||
uses: konveyor/tackle2-operator/.github/actions/start-minikube@main | ||
- name: Build image in minikube | ||
run: | | ||
export SHELL=/bin/bash | ||
eval $(minikube -p minikube docker-env) | ||
make docker-build | ||
- name: Install Tackle | ||
uses: konveyor/tackle2-operator/.github/actions/install-tackle@main | ||
with: | ||
tackle-hub-image: tackle2-hub:latest | ||
tackle-image-pull-policy: IfNotPresent | ||
- name: Set host and namespace | ||
run: | | ||
echo "host=$(minikube ip)/hub" >> $GITHUB_ENV | ||
echo "namespace=$(kubectl get tackles.tackle.konveyor.io --all-namespaces --no-headers | awk '{print $1}')" >> $GITHUB_ENV | ||
- name: Test execution | ||
run: | | ||
HUB_BASE_URL="http://$(minikube ip)/hub" make test-integration | ||
with: | ||
host: ${{ env.host }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package binding | ||
|
||
import ( | ||
"github.com/konveyor/tackle2-hub/api" | ||
) | ||
|
||
// | ||
// Application API. | ||
type Application struct { | ||
// hub API client. | ||
client *Client | ||
} | ||
|
||
// | ||
// Create an Application. | ||
func (h *Application) Create(r *api.Application) (err error) { | ||
err = h.client.Post(api.ApplicationsRoot, &r) | ||
return | ||
} | ||
|
||
// | ||
// Get an Application by ID. | ||
func (h *Application) Get(id uint) (r *api.Application, err error) { | ||
r = &api.Application{} | ||
path := Path(api.ApplicationRoot).Inject(Params{api.ID: id}) | ||
err = h.client.Get(path, r) | ||
return | ||
} | ||
|
||
// | ||
// List Applications. | ||
func (h *Application) List() (list []api.Application, err error) { | ||
list = []api.Application{} | ||
err = h.client.Get(api.ApplicationsRoot, &list) | ||
return | ||
} | ||
|
||
// | ||
// Update an Application. | ||
func (h *Application) Update(r *api.Application) (err error) { | ||
path := Path(api.ApplicationRoot).Inject(Params{api.ID: r.ID}) | ||
err = h.client.Put(path, r) | ||
return | ||
} | ||
|
||
// | ||
// Delete an Application. | ||
func (h *Application) Delete(id uint) (err error) { | ||
err = h.client.Delete(Path(api.ApplicationRoot).Inject(Params{api.ID: id})) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package binding | ||
|
||
import ( | ||
"github.com/konveyor/tackle2-hub/api" | ||
) | ||
|
||
// | ||
// BusinessService API. | ||
type BusinessService struct { | ||
// hub API client. | ||
client *Client | ||
} | ||
|
||
// | ||
// Create a BusinessService. | ||
func (h *BusinessService) Create(r *api.BusinessService) (err error) { | ||
err = h.client.Post(api.BusinessServicesRoot, &r) | ||
return | ||
} | ||
|
||
// | ||
// Get a BusinessService by ID. | ||
func (h *BusinessService) Get(id uint) (r *api.BusinessService, err error) { | ||
r = &api.BusinessService{} | ||
path := Path(api.BusinessServiceRoot).Inject(Params{api.ID: id}) | ||
err = h.client.Get(path, r) | ||
return | ||
} | ||
|
||
// | ||
// List BusinessServices. | ||
func (h *BusinessService) List() (list []api.BusinessService, err error) { | ||
list = []api.BusinessService{} | ||
err = h.client.Get(api.BusinessServicesRoot, &list) | ||
return | ||
} | ||
|
||
// | ||
// Update a BusinessService. | ||
func (h *BusinessService) Update(r *api.BusinessService) (err error) { | ||
path := Path(api.BusinessServiceRoot).Inject(Params{api.ID: r.ID}) | ||
err = h.client.Put(path, r) | ||
return | ||
} | ||
|
||
// | ||
// Delete a BusinessService. | ||
func (h *BusinessService) Delete(id uint) (err error) { | ||
err = h.client.Delete(Path(api.BusinessServiceRoot).Inject(Params{api.ID: id})) | ||
return | ||
} |
Oops, something went wrong.