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

set up github actions for 2.x #36

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
9 changes: 4 additions & 5 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -7,9 +7,8 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_VERSION: '3.0.0-SNAPSHOT'
QUERY_INSIGHTS_BRANCH: 'main'
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
QUERY_INSIGHTS_BRANCH: '2.x'
GRADLE_VERSION: '7.6.1'
jobs:
tests:
@@ -53,8 +52,8 @@ jobs:
- name: Run OpenSearch with Query Insights plugin
run: |
cd query-insights
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
sleep 300
./gradlew run &
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done'
shell: bash

- name: Checkout OpenSearch-Dashboards
2 changes: 1 addition & 1 deletion .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ on:
branches:
- '*'
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
jobs:
tests:
name: Run lint
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "queryInsightsDashboards",
"version": "1.0.0",
"opensearchDashboardsVersion": "3.0.0",
"version": "2.19.0.0",
"opensearchDashboardsVersion": "2.19.0",
"server": true,
"ui": true,
"requiredPlugins": ["navigation"],
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch_query_insights_dashboards",
"version": "3.0.0.0",
"version": "2.19.0.0",
"description": "OpenSearch Dashboards plugin for Query Insights",
"main": "index.js",
"license": "Apache-2.0",

Unchanged files with check annotations Beta

/**
* Validate the main overview page loads correctly
*/
it('should display the main overview page', () => {

Check warning on line 46 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
cy.get('.euiBasicTable').should('be.visible');
cy.contains('Query insights - Top N queries');
cy.url().should('include', '/queryInsights');
/**
* Validate pagination works as expected
*/
it('should paginate the query table', () => {

Check warning on line 84 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
for (let i = 0; i < 20; i++) {
cy.searchOnIndex(indexName);
}
cy.get('.euiTableRow').should('have.length.greaterThan', 0);
});
it('should switch between tabs', () => {

Check warning on line 97 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
// Click Configuration tab
cy.getElementByText('.euiTab', 'Configuration').click({ force: true });
cy.contains('Query insights - Configuration');
cy.url().should('include', '/queryInsights');
});
it('should filter queries', () => {

Check warning on line 108 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
cy.get('.euiFieldSearch').should('be.visible');
cy.get('.euiFieldSearch').type('sample_index');
// Add assertions for filtered results
cy.get('.euiTableRow').should('have.length.greaterThan', 0);
});
it('should clear the search input and reset results', () => {

Check warning on line 115 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
cy.get('.euiFieldSearch').type('random_string');
cy.get('.euiTableRow').should('have.length.greaterThan', 0);
cy.get('.euiFieldSearch').clear();
cy.get('.euiTableRow').should('have.length.greaterThan', 0); // Validate reset
});
it('should display a message when no top queries are found', () => {

Check warning on line 122 in cypress/e2e/1_top_queries.cy.js

GitHub Actions / Run lint

Test has no assertions
clearAll(); // disable top n queries
// waiting for the query insights queue to drain
cy.wait(10000);
cy.get('.euiTableRow').first().find('button').click(); // Navigate to details
});
it('should display correct details on the query details page', () => {

Check warning on line 34 in cypress/e2e/2_query_details.cy.js

GitHub Actions / Run lint

Test has no assertions
// cy.get('.euiBasicTable a').first().click(); // Navigate to details
cy.url().should('include', '/query-details');
// Validate the page title
/**
* Validate summary panel has valid labels
*/
it('the summary panel should display correctly', () => {

Check warning on line 50 in cypress/e2e/2_query_details.cy.js

GitHub Actions / Run lint

Test has no assertions
// Validate all field labels exist
const fieldLabels = [
'Timestamp',
/**
* Validate the latency chart interaction
*/
it('should render the latency chart and allow interaction', () => {

Check warning on line 125 in cypress/e2e/2_query_details.cy.js

GitHub Actions / Run lint

Test has no assertions
// Ensure the chart is visible
cy.get('#latency').should('be.visible');
cy.get('.plot-container').should('be.visible');
/**
* Validate the presence and structure of the Configuration page
*/
it('should display the Configuration page with correct structure', () => {

Check warning on line 23 in cypress/e2e/3_configurations.cy.js

GitHub Actions / Run lint

Test has no assertions
// Validate the page title
cy.get('h1').contains('Query insights - Configuration').should('be.visible');
// Validate the tabs