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

Adds SOM integration tests for serverless #184888

Merged

Conversation

TinaHeiligers
Copy link
Contributor

fix of #175757

Adds serverless api integration tests for Saved Objects Management

@TinaHeiligers TinaHeiligers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes test-api-integration Feature:Saved Objects Management v8.15.0 labels Jun 6, 2024
@jloleysens
Copy link
Contributor

/ci

@TinaHeiligers

This comment was marked as outdated.

@TinaHeiligers

This comment was marked as outdated.

@TinaHeiligers

This comment was marked as outdated.

@TinaHeiligers

This comment was marked as duplicate.

@TinaHeiligers

This comment was marked as duplicate.

@@ -81,244 +78,213 @@ export default function ({ getService }: FtrProviderContext) {
);
await kibanaServer.savedObjects.cleanStandardList();
});
describe('searches', () => {

This comment was marked as outdated.

.set(svlCommonApi.getInternalRequestHeader())
.set(roleAuthc.apiKeyHeader)
.expect(200);
relations1 = body.relations[0];

This comment was marked as outdated.

@TinaHeiligers
Copy link
Contributor Author

TinaHeiligers commented Jun 10, 2024

@TinaHeiligers Hello again madam! I'd like to humbly ask that you run this against MKI, perhaps using QAF?

As these will directly affect the following Monday's serverless, release, it'd be nice to know if they pass on MKI, as the configs that my team were pinged for in the PR, will be run on MKI

@wayneseymour they pass for an elasticsearch project: #184888 (comment).

I'm testing again for an observability and security project to be sure.

@TinaHeiligers TinaHeiligers added ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project and removed ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels Jun 10, 2024
@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor Author

@wayneseymour tests are ok for an o11y project too.

Copy link
Member

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

I believe that if we can change supertest for supertestWithoutAuth where we are passing the internal request header and the api key header, this will be good to go.

Thanks Tina!

export default function ({ getService }: FtrProviderContext) {
const svlCommonApi = getService('svlCommonApi');
const svlUserManager = getService('svlUserManager');
const supertest = getService('supertest');
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should be supertestWithoutAuth, like this:
const supertestWithoutAuth = getService('supertestWithoutAuth');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

it('should return 200 for an existing object', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Should be await supertestWithoutAuth.
\cc @pheyos Please keep me honest here :)

Copy link
Member

Choose a reason for hiding this comment

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

Yes. supertest comes with operator privileges. When we use .set(roleAuthc.apiKeyHeader) to run with a proper role (like it's done here), we need to use supertestWithoutAuth instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}));

it('should return error for invalid object type', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be await supertestWithoutAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}));

it('should return mix of successes and errors', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be await supertestWithoutAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

export default function ({ getService }: FtrProviderContext) {
const svlCommonApi = getService('svlCommonApi');
const svlUserManager = getService('svlUserManager');
const supertest = getService('supertest');
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be const supertestWithoutAuth = getService('supertestWithoutAuth');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

it('should return 200 for object that exists and inject metadata', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be await supertestWithoutAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}));

it('should return error for invalid object type', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be await supertestWithoutAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}));

it('should return mix of successes and errors', async () =>
await supertest
Copy link
Member

Choose a reason for hiding this comment

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

Same as above, should be await supertestWithoutAuth

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TinaHeiligers TinaHeiligers removed ci:project-deploy-observability Create an Observability project ci:project-deploy-security Create a Security Serverless Project labels Jun 12, 2024
@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@TinaHeiligers TinaHeiligers added ci:build-serverless-image ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels Jun 12, 2024
@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #6 / Migration actions - serverless environment readWithPit it excludes documents not matching the provided "query"
  • [job] [logs] Jest Integration Tests #6 / Migration actions - serverless environment readWithPit only returns documents that match the provided "query"
  • [job] [logs] Jest Integration Tests #6 / Migration actions - serverless environment readWithPit requests documents from an index using given PIT

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor Author

@TinaHeiligers Hello again madam! I'd like to humbly ask that you run this against MKI, perhaps using QAF?

As these will directly affect the following Monday's serverless, release, it'd be nice to know if they pass on MKI, as the configs that my team were pinged for in the PR, will be run on MKI

@wayneseymour the tests against MKI (using QAF) passed!

Copy link
Member

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

I just ran the oblt config against MKI, LGTM

@TinaHeiligers TinaHeiligers merged commit c2a82fe into elastic:main Jun 13, 2024
9 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 13, 2024
@TinaHeiligers TinaHeiligers deleted the kbn175757-serverless-SOM-APIint branch June 13, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project Feature:Saved Objects Management release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc test-api-integration v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants