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 e2e test(s) that will test whether routes/apis are reachable #124

Open
shazron opened this issue Feb 24, 2023 · 3 comments
Open

add e2e test(s) that will test whether routes/apis are reachable #124

shazron opened this issue Feb 24, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@shazron
Copy link
Member

shazron commented Feb 24, 2023

Right now we deploy routes/apis via manifest, and they deploy successfully but we do not test whether the routes/apis are reachable.

@shazron shazron added the bug Something isn't working label Feb 24, 2023
@aiojbot
Copy link
Collaborator

aiojbot commented Feb 27, 2023

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2078

@shazron shazron self-assigned this Mar 6, 2023
@shazron
Copy link
Member Author

shazron commented Mar 6, 2023

@shazron
Copy link
Member Author

shazron commented Aug 28, 2023

Runtime limitation - API routes are only created within 5 minutes, thus we can't test them for reachability immediately after creation. e2e code commented out:

aio-lib-runtime/e2e/e2e.js

Lines 126 to 147 in df47319

// we can't test the reachability of the API paths below because it may take up
// to 5 mins for an API to be available:
// https://adobedocs.github.io/adobeio-runtime/guides/creating_rest_apis.html#how-long-does-it-take-to-createupdate-an-api
// const api = apis[0]
// const paths = api.value.apidoc.paths
// for (const key of Object.keys(paths)) {
// if (!key.startsWith('/')) {
// return
// }
// const { createFetch } = require('@adobe/aio-lib-core-networking')
// const path = paths[key]
// for (const verb of Object.keys(path)) {
// const fetch = createFetch()
// const url = `${api.value.gwApiUrl}${key}`
// console.log('testing API Url:', url)
// const response = await fetch(url, { method: verb })
// console.log('API Url response status:', response.status)
// expect(response.status).not.toEqual(404)
// }
// }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants