Skip to content

Commit

Permalink
chore: runInBand for catalog ui tests to avoid flaky (#3782)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Pablo Hernán Carle <pablo.carle@broadcom.com>
Signed-off-by: Andrea Tabone <andrea.tabone@broadcom.com>
Co-authored-by: Pablo Hernán Carle <pablo.carle@broadcom.com>
Co-authored-by: Andrea Tabone <andrea.tabone@broadcom.com>
Co-authored-by: Andrea Tabone <39694626+taban03@users.noreply.github.com>
  • Loading branch information
4 people authored Sep 19, 2024
1 parent ce4bc5c commit 41416b4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-specific-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: ./.github/actions/setup

- name: Build services
run: ./gradlew clean build -x test
run: ./gradlew clean build -x test -x npmTest

- uses: ./.github/actions/teardown

Expand Down
2 changes: 1 addition & 1 deletion api-catalog-ui/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lint": "eslint \"src/**/*.{js,jsx}\"",
"build": "react-app-rewired build",
"postbuild": "rimraf build/**/*.map",
"test": "react-app-rewired test --silent --watchAll=false --env=jsdom components/* utils/* reducers/* epics/* actions/* selectors/* ErrorBoundary/* helpers/* --reporters=default --reporters=jest-html-reporter --coverage",
"test": "react-app-rewired test --runInBand --silent --watchAll=false --env=jsdom components/* utils/* reducers/* epics/* actions/* selectors/* ErrorBoundary/* helpers/* --reporters=default --reporters=jest-html-reporter --coverage",
"cy:open": "cypress open",
"cy:e2e:ci": "cypress run --spec \"cypress/e2e/**/*.cy.js\" --env catalogHomePage=https://gateway-service:10010/apicatalog/ui/v1,gatewayOktaRedirect=https://gateway-service:10010/gateway/oauth2/authorization/okta?returnUrl=https%3A%2F%2Fgateway-service%3A10010%2Fapplication%2Fversion --browser chrome --headless",
"cy:e2e:localhost": "cypress run --spec \"cypress/e2e/**/*.cy.js\" --browser chrome --headless",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,15 @@ describe('>>> Swagger component tests', () => {
endpoint: '/test',
language: 'java',
};
const container = document.createElement('div');
document.body.appendChild(container);

await act(async () =>
createRoot(container).render(<SwaggerUI selectedService={service1} selectedVersion="0" />, container)
const wrapper = shallow(
<div>
<SwaggerUI selectedService={service1} selectedVersion="0" />
</div>
);
expect(container).not.toBeNull();
const swaggerDiv = wrapper.find('#swaggerContainer');

expect(swaggerDiv).toBeDefined();
});

it('should not create element if api portal disabled and element does not exist', () => {
Expand Down
6 changes: 0 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ subprojects {
}
}

task updateCatalogVersion {
ant.replaceregexp(match:'REACT_APP_ZOWE_BUILD_INFO=(.*)', replace:'REACT_APP_ZOWE_BUILD_INFO=' + version, flags:'g', byline:true) {
fileset(dir: 'api-catalog-ui/frontend', includes: '.env')
}
}

task buildCore(dependsOn: [':discovery-service:build', ':api-catalog-services:build', ':api-catalog-ui:build',
':discoverable-client:build', ':zaas-client:build', ':apiml-sample-extension:build', ':gateway-service:build']) {
description "Build core components"
Expand Down

0 comments on commit 41416b4

Please sign in to comment.