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

[Manual][Backport 2.x][Site] update results path based on recent updates for concurrency #741

Merged
Merged
Show file tree
Hide file tree
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
Binary file added site/assets/plugin_test_results_help.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
206 changes: 206 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
<!DOCTYPE html>
<html>

<head>
<title>OSD Functional Test Repo</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<script src="js/dashboard.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="icon" type="image/x-icon" href="https://avatars.githubusercontent.com/u/12060704?v=4">
</head>

<body onload="setDefaultValues()">
<div class="topNav">
<img src="https://opensearch.org/assets/brand/SVG/Logo/opensearch_dashboards_logo_darkmode.svg"/>
<span>Functional Test Results Explorer</span>
<a href="https://github.com/opensearch-project/opensearch-dashboards-functional-test">
Github
</a>
<a href="https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/new?assignees=&labels=enhancement%2C+untriaged&template=FEATURE_REQUEST_TEMPLATE.md&title=%5BFEATURE%5D">
Plugin Not Here?
</a>
</div>
<div id="advancedConfigDiv">
<table>
<tr>
<th>
Advanced Configurations
</th>
</tr>
<tr>
<td id="advancedConfigTd">
<input type="checkbox" id="advancedConfig" onclick="enableAdvancedConfig()">
</td>
</tr>
</table>
</div>
<div id="descriptionDiv">
Welcome to the test results explorer! Please enter the version and build number to view results.
<br><br>
<i>NOTE: You might need to add an extension to view the results in UTF-8. Otherwise, download directly.</i>
</div>
<div id="inputsDiv">
<table>
<tr>
<th>Version</th>
<th>Build Number</th>
</tr>
<tr>
<td>
<input type="text" id="version" value="2.5.0">
</td>
<td>
<input type="text" id="buildNumber" value="5367">
</td>
</tr>
</table>
<table>
<tr>
<th>Platform</th>
<th>Arch</th>
<th>Type</th>
<th>With Security</th>
</tr>
<tr>
<td>
<select id="platform">
<option value="linux">Linux</option>
<option value="windows">Windows</option>
</select>
</td>
<td>
<select id="arch">
<option value="x64">x64</option>
<option value="arm64">arm64</option>
</select>
</td>
<td>
<select id="type">
<option value="tar">tar</option>
<option value="rpm">rpm</option>
</select>
</td>
<td id="securityTd">
<input type="checkbox" id="security">
</td>
</tr>
<tr>
<th>Test Number</th>
</tr>
<tr>
<td>
<input type="text" id="testNumber" value="2993">
</td>
</tr>
</table>
<table id="advancedInputsTable">
<tr>
<th>Test Job Name</th>
<th>Legacy Tests Results</th>
</tr>
<tr>
<td>
<input style="width:50vw" type="text" id="testJobName" value="integ-test-opensearch-dashboards">
</td>
<td id="legacyTd">
<input type="checkbox" id="legacyResults">
</td>
</tr>
</table>
<button id="submitButton" onclick="getTestResults()">Submit</button>
</div>
<div id="testResultsLinksDiv">
<h2>Useful Links:</h2>
<ul>
<li>
Link to this page: <a id="resultPageLink"></a>
</li>
<li>
<a id="testResultLink"></a>
</li>
<li>
<a id="manifestLink"></a>
</li>
<li>
<a id="osdLink"></a>
</li>
<li>
<a id="osLink"></a>
</li>
<li>
<a id="jenkinsLink"></a>
</li>
</ul>
<h2>Plugins:</h2>
<table>
<tr>
<td id="pluginButtonsTd">
<button id="alertingDashboardsButton" onclick="getPluginLinks('alerting-dashboards-plugin')">
alertingDashboards
</button>
<button id="anomalyDetectionDashboardsButton" onclick="getPluginLinks('anomaly-detection-dashboards-plugin')">
anomalyDetectionDashboards
</button>
<button id="customImportMapDashboardsButton" onclick="getPluginLinks('custom-import-map-dashboards')">
customImportMapDashboards
</button>
<button id="ganttChartDashboardsButton" onclick="getPluginLinks('gantt-chart-dashboards')">
ganttChartDashboards
</button>
<button id="indexManagementDashboardsButton" onclick="getPluginLinks('index-management-dashboards-plugin')">
indexManagementDashboards
</button>
<button id="mlCommonsDashboardsButton" onclick="getPluginLinks('ml-commons-dashboards')">
mlCommonsDashboards
</button>
<button id="notificationsDashboardsButton" onclick="getPluginLinks('notifications-dashboards')">
notificationsDashboards
</button>
<button id="observabilityDashboardsButton" onclick="getPluginLinks('observability-dashboards')">
observabilityDashboards
</button>
<button id="queryWorkbenchDashboardsButton" onclick="getPluginLinks('query-workbench-dashboards')">
queryWorkbenchDashboards
</button>
<button id="reportsDashboardsButton" onclick="getPluginLinks('reports-dashboards')">
reportsDashboards
</button>
<button id="searchRelevanceDashboardsButton" onclick="getPluginLinks('search-relevance-dashboards')">
searchRelevanceDashboards
</button>
<button id="securityDashboardsButton" onclick="getPluginLinks('security')">
securityDashboards
</button>
<button id="securityAnalyticsDashboardsButton" onclick="getPluginLinks('security-analytics-dashboards-plugin')">
securityAnalyticsDashboards
</button>
</tr>
</table>
</div>
<div id="pluginLinksDiv">
<button onclick="closePluginLinks()">Close</button>
<h2 id="pluginName"></h2>
<span><i>NOTE: If you are getting errors accessing these links, please verify the plugin is within the build manifest (within the useful links section).</i></span>
<br>
<span>If your plugin is not in the build manifest, please verify it has been added to:</span>
<span id="githubManifestLink"></span>
<br><br>
<span id="pluginLink"></span>
<br><br>
<span id="screenshotHelper">
Screenshots of failed tests can be found by checking the <b>Test Results</b> section for <b>(Screenshots)</b> converting:
<br>
<code id="baseScreenshotUrlBefore"></code>
<br>to<br>
<code id="baseScreenshotUrlAfter"></code>
</span>
<ul id="pluginLinksList"></ul>
</div>
<div id="testResultsDiv">
<h2>Test Results:</h2>
<iframe id="testResults"><meta charset="utf-8"></iframe>
</div>
</body>

</html>
114 changes: 91 additions & 23 deletions site/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
*/

const defaults = {
version: '2.0.1',
buildNumber: '3958',
testNumber: '1',
version: '2.8.0',
buildNumber: '6177',
testNumber: '3616',
testJobName: 'integ-test-opensearch-dashboards',
platform: 'linux',
arch: 'x64',
type: 'tar',
withSecurity: false,
advancedConfig: false,
showLegacyTestResults: false,
};

const plugins = {
Expand Down Expand Up @@ -138,17 +141,6 @@ function getTestResults() {
const arch = document.getElementById('arch').value;
const type = document.getElementById('type').value;
const securityEnabled = document.getElementById('security').checked;
const testResultsUrl =
'https://ci.opensearch.org/ci/dbc/' +
`${testJobName}/` +
`${version}/` +
`${buildNumber}/` +
`${platform}/` +
`${arch}/` +
`${type}/` +
`test-results/${testNumber}/integ-test/functionalTestDashboards/` +
`${securityEnabled ? 'with-security' : 'without-security'}/` +
'test-results/stdout.txt';

document.getElementById('testResultsLinksDiv').style.display = 'block';

Expand All @@ -167,10 +159,6 @@ function getTestResults() {
resultPageLink.textContent = resultPageUrl;
resultPageLink.href = resultPageUrl;

var testResultsLink = document.getElementById('testResultLink');
testResultsLink.textContent = testResultsUrl;
testResultsLink.href = testResultsUrl;

const osdUrl =
'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/' +
`${version}/` +
Expand Down Expand Up @@ -211,6 +199,35 @@ function getTestResults() {
osLink.textContent = osUrl;
osLink.href = osUrl;

const jenkinsUrl =
'https://build.ci.opensearch.org/job/' +
`${testJobName}/` +
`${testNumber}`;
var jenkinsLink = document.getElementById('jenkinsLink');
jenkinsLink.textContent = jenkinsUrl;
jenkinsLink.href = jenkinsUrl;

if (!enableLegacyTestsResults()) {
hideLegacyTestsResults();
return;
}

const testResultsUrl =
'https://ci.opensearch.org/ci/dbc/' +
`${testJobName}/` +
`${version}/` +
`${buildNumber}/` +
`${platform}/` +
`${arch}/` +
`${type}/` +
`test-results/${testNumber}/integ-test/functionalTestDashboards/` +
`${securityEnabled ? 'with-security' : 'without-security'}/` +
'test-results/stdout.txt';

var testResultsLink = document.getElementById('testResultLink');
testResultsLink.textContent = testResultsUrl;
testResultsLink.href = testResultsUrl;

document.getElementById('testResultsDiv').style.display = 'block';
document.getElementById('testResults').src =
decodeURIComponent(testResultsUrl);
Expand All @@ -222,6 +239,17 @@ function enableAdvancedConfig() {
document.getElementById('advancedConfig').checked ? 'block' : 'none';
}

function enableLegacyTestsResults() {
return document.getElementById('legacyResults').checked;
}

function hideLegacyTestsResults() {
document.getElementById('testResultsDiv').style.display = 'none';
var testResultsLink = document.getElementById('testResultLink');
testResultsLink.textContent = 'How to view test results for plugins';
testResultsLink.href = 'assets/plugin_test_results_help.gif';
}

// eslint-disable-next-line no-unused-vars
function getPluginLinks(plugin) {
document.getElementById('pluginLinksList').innerHTML = '';
Expand Down Expand Up @@ -256,6 +284,29 @@ function getPluginLinks(plugin) {
githubManifestLink.href = `https://github.com/opensearch-project/opensearch-build/blob/main/manifests/${version}/opensearch-dashboards-${version}.yml`;
document.getElementById('githubManifestLink').appendChild(githubManifestLink);

if (!enableLegacyTestsResults()) {
const testResultsUrl =
'https://ci.opensearch.org/ci/dbc/' +
`${testJobName}/` +
`${version}/` +
`${buildNumber}/` +
`${platform}/` +
`${arch}/` +
`${type}/` +
`test-results/${testNumber}/integ-test/` +
`${pluginObject.name}/` +
`${securityEnabled ? 'with-security' : 'without-security'}/` +
'stdout.txt';

var pluginTestResultLink = document.createElement('a');
pluginTestResultLink.textContent = testResultsUrl;
pluginTestResultLink.href = testResultsUrl;
document.getElementById('pluginLink').appendChild(pluginTestResultLink);

const ruleElement = document.createElement('hr');
document.getElementById('pluginLink').appendChild(ruleElement);
}

var pluginLink = document.createElement('a');
pluginLink.textContent = pluginUrl;
pluginLink.href = pluginUrl;
Expand All @@ -269,14 +320,22 @@ function getPluginLinks(plugin) {
`${platform}/` +
`${arch}/` +
`${type}/` +
`test-results/${testNumber}/integ-test/functionalTestDashboards/` +
`${securityEnabled ? 'with-security' : 'without-security'}`;
const screenshotBaseUrl = `${s3BaseUrl}/test-results/cypress-screenshots/plugins/${plugin}/$SPEC_FILE/$FULL_TEST_FAILURE.png`;
const videosBaseUrl = `${s3BaseUrl}/test-results/cypress-videos/plugins/${plugin}`;
`test-results/${testNumber}/integ-test/` +
`${
enableLegacyTestsResults()
? 'functionalTestDashboards'
: pluginObject.name
}/` +
`${securityEnabled ? 'with-security' : 'without-security'}` +
`${enableLegacyTestsResults() ? 'test-results' : ''}`;
const screenshotBaseUrl = `${s3BaseUrl}/cypress-screenshots/plugins/${plugin}/$SPEC_FILE/$FULL_TEST_FAILURE.png`;
const videosBaseUrl = `${s3BaseUrl}/cypress-videos/plugins/${plugin}`;

document.getElementById(
'baseScreenshotUrlBefore'
).innerHTML = `/tmp/$RANDOM/functionalTestDashboards/cypress/screenshots/plugins/${plugin}/$SPEC_FILE/$FULL_TEST_FAILURE.png`;
).innerHTML = `/tmp/$RANDOM/${
enableLegacyTestsResults() ? 'functionalTestDashboards' : pluginObject.name
}/cypress/screenshots/plugins/${plugin}/$SPEC_FILE/$FULL_TEST_FAILURE.png`;
document.getElementById('baseScreenshotUrlAfter').innerHTML =
screenshotBaseUrl;

Expand Down Expand Up @@ -324,4 +383,13 @@ function setDefaultValues() {
document.getElementById('type').value = params.get('type')
? params.get('type')
: defaults.type;
document.getElementById('security').checked = params.get('with_security')
? params.get('with_security').toLowerCase() === 'true'
: defaults.withSecurity;
document.getElementById('advancedConfig').checked = defaults.advancedConfig;
document.getElementById('legacyResults').checked = params.get(
'legacy_results'
)
? params.get('legacy_results').toLowerCase() === 'true'
: defaults.showLegacyTestResults;
}
Loading
Loading