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

feat: Add AI Core e2e tests #128

Merged
merged 19 commits into from
Sep 19, 2024
Merged

feat: Add AI Core e2e tests #128

merged 19 commits into from
Sep 19, 2024

Conversation

shibeshduw
Copy link
Contributor

@shibeshduw shibeshduw commented Sep 11, 2024

Context

Added e2e test flow for DeploymentApi that covers starting a deployment(POST), stopping a deployment(PATCH) and deleting a deployment(DELETE), along with a precondition and postcondition check(GET).

Test run: https://github.com/SAP/ai-sdk-js/actions/runs/10811128561

Closes: AI/gen-ai-hub-sdk-js-backlog#59.

Definition of Done

  • Code is tested (Unit, E2E)
  • Error handling created / updated & covered by the tests above
  • [ ] Documentation updated
  • [ ] (Optional) Aligned changes with the Java SDK
  • [ ] (Optional) Release notes updated

tests/e2e-tests/src/ai-core.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-core.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
}, 180000);

it('should modify the deployment to stop it', async () => {
expect(createdDeploymentId).toBeDefined();
Copy link
Contributor

Choose a reason for hiding this comment

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

[pp] I think it would be better if we could have a way to run the tests independently. In case something is not working, I would always have to run all tests in order, so local testing is a bit difficult: I couldn't run one test at a time...

My thoughts:

  1. I expect that we have no running deployments before we run the tests. This means when I would like to run the modification or deletion test, I couldn't run this test individually.
    A fix could be that I have to run the creation manually before (e.g. running the creation test) and then to run modification individually, query the deployment instead of keeping a global state.
    This is still inconvenient, so the tests could try to retrieve the global state, if not set query the deployment, if not there create it as needed.

  2. Another thought is - if tests fail or are cancelled before they are finished, it is possible that we accumulate more and more deployments - I guess we should consider some kind of a clean up step.

I guess 1. could be a bit overkill or could be done later. I think 2. could be useful.
Thoughts @deekshas8 @MatKuhr @ZhongpinWang @KavithaSiva @tomfrenken

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we could use jest's pattern matching to run individual tests but also keep this flow? Plus we also add a cleanup step as you mentioned.

tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
tests/e2e-tests/src/ai-api.test.ts Outdated Show resolved Hide resolved
)
});

function getDeploymentId(id: string | undefined): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the idea here is that later on this can be used to fetch a deployment ID in case it does not exist, right?

@marikaner marikaner merged commit 0924084 into main Sep 19, 2024
9 checks passed
@marikaner marikaner deleted the aicore-e2e-tests branch September 19, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants