Skip to content

Commit

Permalink
Update Enterprise Search functional tests (without host) to run on CI
Browse files Browse the repository at this point in the history
- Fix incorrect navigateToApp slug (hadn't realized this was a URL, not an ID)
- Update without_host_configured tests to run without API key
- Update README
  • Loading branch information
cee-chen committed Jul 8, 2020
1 parent d6740f2 commit 5136952
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions x-pack/scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const onlyNotInCoverageTests = [
require.resolve('../test/reporting_api_integration/config.js'),
require.resolve('../test/functional_embedded/config.ts'),
require.resolve('../test/ingest_manager_api_integration/config.ts'),
require.resolve('../test/functional_enterprise_search/without_host_configured.config.ts'),
];

require('@kbn/plugin-helpers').babelRegister();
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/functional_enterprise_search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Ex.
# Run specs from the x-pack directory
cd x-pack

# Run tests that do not require enterpriseSearch.host variable
node scripts/functional_tests --config test/functional_enterprise_search/without_host_configured.config.ts

# Run tests that require enterpriseSearch.host variable
APP_SEARCH_API_KEY=[use private key from local App Search instance here] node scripts/functional_tests --config test/functional_enterprise_search/with_host_configured.config.ts

# Run tests that do not require enterpriseSearch.host variable
APP_SEARCH_API_KEY=[use private key from local App Search instance here] node scripts/functional_tests --config test/functional_enterprise_search/without_host_configured.config.ts
```

## Enterprise Search Requirement

These tests will not currently start an instance of App Search automatically. As such, they are not run as part of CI and are most useful for local regression testing.
The `with_host_configured` tests will not currently start an instance of App Search automatically. As such, they are not run as part of CI and are most useful for local regression testing.

The easiest way to start Enterprise Search for these tests is to check out the `ent-search` project
and use the following script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function AppSearchPageProvider({ getService, getPageObjects }: FtrProvide

return {
async navigateToPage(): Promise<void> {
return await PageObjects.common.navigateToApp('appSearch');
return await PageObjects.common.navigateToApp('enterprise_search/app_search');
},

async getEngineLinks(): Promise<WebElementWrapper[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ export async function AppSearchServiceProvider({ getService }: FtrProviderContex
const security = getService('security');

lifecycle.beforeTests.add(async () => {
const APP_SEARCH_API_KEY = process.env.APP_SEARCH_API_KEY;

if (!APP_SEARCH_API_KEY) {
throw new Error('Please provide a valid APP_SEARCH_API_KEY. See README for more details.');
}

// The App Search plugin passes through the current user name and password
// through on the API call to App Search. Therefore, we need to be signed
// in as the enterprise_search user in order for this plugin to work.
Expand Down

0 comments on commit 5136952

Please sign in to comment.