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

Fix an error in GitHub action tests #184

Open
wants to merge 35 commits into
base: 4.12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
98e8660
Fixed mvn download destination
JuanGarriuz Feb 7, 2025
322912a
search tenancy feature
JuanGarriuz Feb 10, 2025
d28fa48
Repair cypress test
JuanGarriuz Feb 10, 2025
0f394f2
Repair test
JuanGarriuz Feb 10, 2025
3c65047
Revert "Repair test"
JuanGarriuz Feb 10, 2025
cd34d08
Fix saml_auth_test
JuanGarriuz Feb 10, 2025
0a7c780
Fix saml_auth_test
JuanGarriuz Feb 10, 2025
502ed8d
Check dashboard port
JuanGarriuz Feb 11, 2025
0502f02
Restore 5601 port
JuanGarriuz Feb 11, 2025
044b96f
Use cy.origin
JuanGarriuz Feb 11, 2025
d033fd4
Fix typo
JuanGarriuz Feb 11, 2025
3d1a9f8
Added origin
JuanGarriuz Feb 11, 2025
8581263
Remove origin
JuanGarriuz Feb 11, 2025
71d3357
Revert wz-home path
JuanGarriuz Feb 12, 2025
0cbf8e2
Add origin
JuanGarriuz Feb 12, 2025
7a0be8c
Add origin
JuanGarriuz Feb 12, 2025
47404ac
Add console log
JuanGarriuz Feb 12, 2025
25d4b3d
Prove origin
JuanGarriuz Feb 12, 2025
4c4816b
Prove origin
JuanGarriuz Feb 12, 2025
58b4fb3
Prove origin
JuanGarriuz Feb 12, 2025
aeb5a1c
Added prettier
JuanGarriuz Feb 12, 2025
05fa18c
Origin fix
JuanGarriuz Feb 12, 2025
0699640
Origin fix
JuanGarriuz Feb 12, 2025
b8e1325
Test origin
JuanGarriuz Feb 12, 2025
3316c83
modified cypress version
JuanGarriuz Feb 13, 2025
45dddca
fix prettier
JuanGarriuz Feb 13, 2025
5c97748
modified cypress version
JuanGarriuz Feb 13, 2025
6bafb95
Remove check that not exists on OSD
JuanGarriuz Feb 13, 2025
e68e9a6
restore checks
JuanGarriuz Feb 13, 2025
a199a0b
Rename app path
JuanGarriuz Feb 14, 2025
5966f97
Add log
JuanGarriuz Feb 14, 2025
d63029c
Add log
JuanGarriuz Feb 14, 2025
f417d5a
Removed tests with wz-home path
JuanGarriuz Feb 14, 2025
abf2c36
Rename path
JuanGarriuz Feb 14, 2025
ff210b2
Revert
JuanGarriuz Feb 14, 2025
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
6 changes: 3 additions & 3 deletions .github/actions/download-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
mvn dependency:get \
-DremoteRepositories=https://aws.oss.sonatype.org/content/repositories/snapshots/ \
-Dartifact=org.opensearch.plugin:${{ inputs.plugin-name }}:${{ inputs.plugin-version }}-SNAPSHOT:zip \
-Dtransitive=false \
-Ddest=${{ inputs.download-location }}.zip
-Dtransitive=false
# Ddest flag is obsolete, to copy correctly "cp" is must be run like => (https://github.com/opensearch-project/security-dashboards-plugin/commit/90b2e773b30861bde0ef5e16ea8fe0713ddf5512)
cp ~/.m2/repository/org/opensearch/plugin/${{ inputs.plugin-name }}/${{ inputs.plugin-version }}-SNAPSHOT/${{ inputs.plugin-name }}-${{ inputs.plugin-version }}-SNAPSHOT.zip ${{ inputs.download-location }}.zip
shell: bash

2 changes: 1 addition & 1 deletion .github/actions/run-cypress-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ runs:
attempt_limit: 5
attempt_delay: 2000
command: |
yarn add cypress --save-dev
yarn add cypress@13.5.1 --save-dev
eval ${{ inputs.yarn_command }}
2 changes: 1 addition & 1 deletion .github/workflows/cypress-test-tenancy-disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ jobs:
git clone https://github.com/opensearch-project/opensearch-dashboards-functional-test.git -b ${{ env.OPENSEARCH_VERSION }}
cd opensearch-dashboards-functional-test
npm install cypress --save-dev
yarn cypress:run-with-security --browser chrome --spec "cypress/integration/plugins/security/inaccessible_tenancy_features.js"
yarn cypress:run-with-security --browser chrome --spec "cypress/integration/plugins/security-dashboards-plugin/inaccessible_tenancy_features.js"
17 changes: 7 additions & 10 deletions test/cypress/e2e/saml/saml_auth_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

// Avoid Cypress lock onto the ipv4 range, so fake `visit()` before `request()`.
// See: https://github.com/cypress-io/cypress/issues/25397#issuecomment-1402556488
cy.visit(`http://localhost:7000${basePath}`);
cy.visit(`http://localhost:5601${basePath}`);

cy.createRoleMapping(ALL_ACCESS_ROLE, samlUserRoleMapping);
cy.clearCookies();
Expand All @@ -50,14 +50,13 @@
}
};

it('Login to app/wz-home_overview#/ when SAML is enabled', () => {
it('Login to app/opensearch_dashboards_overview#/ when SAML is enabled', () => {
localStorage.setItem('opendistro::security::tenant::saved', '"__user__"');
localStorage.setItem('home:newThemeModal:show', 'false');

cy.visit(`http://localhost:7000${basePath}/app/wz-home_overview`, {
cy.visit(`http://localhost:5601${basePath}/app/opensearch_dashboards_overview`, {
failOnStatusCode: false,
});

samlLogin();

cy.get('#osdOverviewPageHeader__title').should('be.visible');
Expand All @@ -68,7 +67,7 @@
localStorage.setItem('opendistro::security::tenant::saved', '"__user__"');
localStorage.setItem('home:newThemeModal:show', 'false');

cy.visit(`http://localhost:7000${basePath}/app/dev_tools#/console`, {
cy.visit(`http://localhost:5601${basePath}/app/dev_tools#/console`, {
failOnStatusCode: false,
});

Expand All @@ -82,7 +81,7 @@
localStorage.setItem('opendistro::security::tenant::saved', '"__user__"');
localStorage.setItem('home:newThemeModal:show', 'false');

const urlWithHash = `http://localhost:7000${basePath}/app/security-dashboards-plugin#/getstarted`;
const urlWithHash = `http://localhost:5601${basePath}/app/security-dashboards-plugin#/getstarted`;

cy.visit(urlWithHash, {
failOnStatusCode: false,
Expand All @@ -97,17 +96,15 @@
it('Tenancy persisted after logout in SAML', () => {
localStorage.setItem('home:newThemeModal:show', 'false');

cy.visit(`http://localhost:7000${basePath}/app/wz-home_overview`, {
cy.visit(`http://localhost:5601${basePath}/app/opensearch_dashboards_overview`, {
failOnStatusCode: false,
});

samlLogin();
cy.get('#user-icon-btn').should('be.visible');
cy.get('#user-icon-btn').click();
cy.get('button[data-test-subj^="switch-tenants"]').click();

cy.get('#private').should('be.enabled');
cy.get('#private').click({ force: true });

Check warning on line 107 in test/cypress/e2e/saml/saml_auth_test.spec.js

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Do not use force on click and type calls

Check warning on line 107 in test/cypress/e2e/saml/saml_auth_test.spec.js

View workflow job for this annotation

GitHub Actions / Run unit tests (ubuntu-latest)

Do not use force on click and type calls

cy.get('button[data-test-subj="confirm"]').click();

Expand All @@ -133,7 +130,7 @@
// We need to explicitly clear cookies,
// since the Shorten URL api is return's set-cookie header for admin user.
cy.clearCookies().then(() => {
const gotoUrl = `http://localhost:7000${basePath}/goto/${response.urlId}?security_tenant=global`;
const gotoUrl = `http://localhost:5601${basePath}/goto/${response.urlId}?security_tenant=global`;
cy.visit(gotoUrl);
samlLogin();
cy.getCookie('security_authentication').should('exist');
Expand Down
Loading