-
Notifications
You must be signed in to change notification settings - Fork 34
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
🌱 Initial Hub API Tests #268
Changes from all commits
8624f9d
8cbbdae
fcd1f41
4826fba
908286c
368a743
253a1b8
b035ee8
addefad
1e38d5b
9e0d7e7
30afe82
2b1e547
123b8b4
678be79
99e7fa2
f1b2282
86ed48d
661f262
072e133
427b194
9f9e554
1363e93
60da208
9a26e95
64954cb
1c3b13e
80713e3
2e9ad8a
1e4edde
1c43b4f
f2c8102
87acce0
67bc4b9
7f71124
c9e329f
ba7f1f5
e9a4766
ef59abc
96f0789
a00ef5c
228b623
56310a5
33c4894
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 }} |
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 | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The binding should follow the same signature pattern as the addon binding.
In the future, the List() should also support filter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack, will update binding pkg&tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Application methods in binding package were updated according to comment above. |
||
|
||
// | ||
// 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 | ||
} |
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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be more inclined for us to run all these tests post-merge to main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK removing nightly build from this PR, but I believe that schedule-based application-level tests should run within the upstream CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep for now to see how it works