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

feat(ci): Test with forked main13 #98

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3285a16
build(deps): bump ubi8/openjdk-17-runtime in /src/container (#1733)
dependabot[bot] Oct 20, 2023
3a650be
build(web-client): update submodule to 9ec90e1
Oct 20, 2023
5602cf9
build(web-client): update submodule to 1f32dea
Oct 20, 2023
13101c3
build(web-client): update submodule to 316e9c7
Oct 23, 2023
89a64d7
build(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#1740)
dependabot[bot] Oct 24, 2023
fd2b69a
build(deps): bump org.owasp:dependency-check-maven from 8.4.0 to 8.4.…
dependabot[bot] Oct 24, 2023
a42fe3f
build(web-client): update submodule to a011a5d
Oct 24, 2023
6a3b4f4
added new workflow file for removing label part
aali309 Aug 31, 2023
fbd9731
apply fixes
aali309 Sep 1, 2023
ef8546c
test25
aali309 Sep 1, 2023
4178f17
update
aali309 Sep 20, 2023
916477b
build_test command enhancements
aali309 Sep 22, 2023
afd3c17
resolved issues
aali309 Sep 25, 2023
6f6a9a8
added separate itest
aali309 Oct 10, 2023
e1e531c
added separate itest for /retest
aali309 Oct 10, 2023
502372b
returned pr-request-review.yml to its original state
aali309 Oct 10, 2023
8fdf8de
added owner
aali309 Oct 10, 2023
2bf2f1c
edited workflow to load image that was built
aali309 Oct 11, 2023
7e4cf64
testing
aali309 Oct 11, 2023
c5d58ee
added test pass and retest job
aali309 Oct 13, 2023
975ddd5
added extra conditions on retest intergration
aali309 Oct 13, 2023
04f49f3
removed unnecessary step:always()
aali309 Oct 16, 2023
58fb6da
separated workflows build and itest
aali309 Oct 24, 2023
ef22644
resolved issues
aali309 Oct 24, 2023
ff2e21d
testing13
aali309 Oct 24, 2023
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
64 changes: 11 additions & 53 deletions .github/workflows/ci-build-image.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: build cryostat image

on:
workflow_call:
inputs:
Expand All @@ -10,10 +12,6 @@ on:
build-arch:
required: true
type: string
skip-itests:
required: false
type: boolean
default: false
outputs:
image-version:
description: the Cryostat application version that will be built
Expand Down Expand Up @@ -42,6 +40,8 @@ jobs:

build-image:
runs-on: ubuntu-latest
permissions:
pull-requests: write
needs: [get-pom-properties]
steps:
- name: Install qemu
Expand All @@ -51,7 +51,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/checkout@v4
if: always()
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
Expand All @@ -64,8 +63,13 @@ jobs:
- name: maven-settings
uses: s4u/maven-settings-action@v2
with:
servers: '[{"id": "github", "username": "dummy", "password": "${env.GITHUB_TOKEN_REF}"}]'
githubServer: false
githubServer: true
- name: ghcr login
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.event.comment.user.login }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: skjolber/maven-cache-github-action@v1
with:
step: restore
Expand All @@ -83,49 +87,3 @@ jobs:
- uses: skjolber/maven-cache-github-action@v1
with:
step: save

integration-tests:
runs-on: ubuntu-latest
needs: [build-image]
if: ${{ ! inputs.skip-itests }}
steps:
- name: Install xpath
run: |
sudo apt-get update
sudo apt-get install -y libxml-xpath-perl
- name: Install qemu
if: ${{ inputs.build-arch != 'amd64' }}
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/checkout@v4
if: always()
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
submodules: true
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/download-artifact@v3
with:
name: cryostat-${{ inputs.build-arch }}
- name: Load cryostat image
run: podman load -i cryostat-${{ inputs.build-arch }}.tar
- uses: skjolber/maven-cache-github-action@v1
with:
step: restore
- name: Run integration tests
run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest ITEST_IMG_VERSION=latest bash repeated-integration-tests.bash
- name: Print itest logs
if: failure()
run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat
- name: Print itest container logs
if: failure()
run: ls -1dt target/cryostat-*.server.log | head -n1 | xargs cat
- uses: skjolber/maven-cache-github-action@v1
with:
step: save
79 changes: 79 additions & 0 deletions .github/workflows/integrated-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Retest Integrated Tests

on:
workflow_call:
inputs:
checkout-repo:
required: false
type: string
checkout-ref:
required: false
type: string
build-arch:
required: true
type: string
pr-number:
required: false
type: string
sha-value:
required: false
type: string
skip-itests:
required: false
type: boolean
default: false

permissions:
contents: read
packages: read


jobs:
integration-tests: #test
runs-on: ubuntu-latest
if: ${{ !inputs.skip-itests }}
steps:
- name: Install xpath
run: |
sudo apt-get update
sudo apt-get install -y libxml-xpath-perl
- name: Install qemu
if: ${{ inputs.build-arch != 'amd64' }}
continue-on-error: true
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- uses: actions/checkout@v4
with:
repository: ${{ inputs.checkout-repo }}
ref: ${{ inputs.checkout-ref }}
submodules: true
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: maven-settings
uses: s4u/maven-settings-action@v2
with:
githubServer: true
- name: ghcr login
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.event.comment.user.login }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull cryostat image
run: podman pull ghcr.io/${{ github.repository_owner }}/cryostat:pr-${{ inputs.pr-number }}-${{ inputs.sha-value }}-linux-${{ inputs.build-arch }}
- name: retag image as quay
run: podman tag ghcr.io/${{ github.repository_owner }}/cryostat:pr-${{ inputs.pr-number }}-${{ inputs.sha-value }}-linux-${{ inputs.build-arch}} quay.io/cryostat/cryostat
- name: Run integration tests
run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest ITEST_IMG_VERSION=latest bash repeated-integration-tests.bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print itest logs
if: failure()
run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat
- name: Print itest container logs
if: failure()
run: ls -1dt target/cryostat-*.server.log | head -n1 | xargs catyea
104 changes: 91 additions & 13 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
jobs:
check-before-build:
runs-on: ubuntu-latest
if: github.repository_owner == 'cryostatio' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test')
if: github.event.issue.pull_request && (startsWith(github.event.comment.body, '/build_test') || startsWith(github.event.comment.body, '/retest'))
permissions:
pull-requests: write
steps:
- name: Fail if needs-triage label applied
- name: Fail if needs-triage label applied
if: ${{ contains(github.event.issue.labels.*.name, 'needs-triage') }}
run: exit 1
- name: Show warning if permission is denied
Expand All @@ -43,12 +43,12 @@ jobs:
repo,
comment_id: context.payload.comment.id,
content: "+1",
});
});

checkout-branch:
checkout-branch:
runs-on: ubuntu-latest
needs: [check-before-build]
outputs:
outputs:
PR_head_ref: ${{ fromJSON(steps.comment-branch.outputs.result).ref }}
PR_head_sha: ${{ fromJSON(steps.comment-branch.outputs.result).sha }}
PR_num: ${{ fromJSON(steps.comment-branch.outputs.result).num }}
Expand All @@ -69,13 +69,33 @@ jobs:

code-analysis:
needs: [checkout-branch]
if: startsWith(github.event.comment.body, '/build_test')
uses: ./.github/workflows/ci-code-analysis.yml
with:
checkout-repo: ${{ needs.checkout-branch.outputs.PR_repo }}
checkout-ref: ${{ needs.checkout-branch.outputs.PR_head_ref }}

build-and-test:
needs: [code-analysis, checkout-branch]

start-comment:
runs-on: ubuntu-latest
needs: [check-before-build]
steps:
- name: Leave Actions Run Comment
uses: actions/github-script@v6
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const currentTime = new Date().toLocaleString('en-US', { timeZone: 'America/Toronto' });
const commentBody = `Workflow started at ${currentTime}. [View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});

build-image:
needs: [checkout-branch]
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/build_test')
strategy:
matrix:
arch: [amd64, arm64]
Expand All @@ -84,15 +104,14 @@ jobs:
build-arch: ${{ matrix.arch }}
checkout-repo: ${{ needs.checkout-branch.outputs.PR_repo }}
checkout-ref: ${{ needs.checkout-branch.outputs.PR_head_ref }}
skip-itests: ${{ matrix.arch != 'amd64' }}

push-to-ghcr:
runs-on: ubuntu-latest
needs: [build-and-test, checkout-branch]
needs: [checkout-branch, build-image]
strategy:
matrix:
arch: [amd64, arm64]
outputs:
outputs:
amd64_image: ${{ steps.amd64_image.outputs.image }}
arm64_image: ${{ steps.arm64_image.outputs.image }}
env:
Expand Down Expand Up @@ -138,7 +157,7 @@ jobs:
- name: Create markdown table
id: md-table
uses: petems/[email protected]
with:
with:
csvinput: |
ARCH, IMAGE
amd64, ${{ env.amd64_image }}
Expand All @@ -150,9 +169,68 @@ jobs:

To run smoketest:
```
# amd64
# amd64
CRYOSTAT_IMAGE=${{ env.amd64_image }} sh smoketest.sh

# or arm64
CRYOSTAT_IMAGE=${{ env.arm64_image }} sh smoketest.sh
```

integration-test:
needs: [checkout-branch, push-to-ghcr]
strategy:
matrix:
arch: [amd64, arm64]
uses: ./.github/workflows/integrated-test.yml
with:
build-arch: ${{ matrix.arch }}
pr-number: ${{ github.event.issue.number }}
sha-value: ${{ needs.checkout-branch.outputs.PR_head_sha }}
skip-itests: ${{ matrix.arch == 'arm64' }}

retest-integration:
needs: [checkout-branch]
if: contains(github.event.comment.body, '/retest')
strategy:
matrix:
arch: [amd64, arm64]
uses: ./.github/workflows/integrated-test.yml
with:
build-arch: ${{ matrix.arch }}
pr-number: ${{ github.event.issue.number }}
sha-value: ${{ needs.checkout-branch.outputs.PR_head_sha }}
skip-itests: ${{ matrix.arch == 'arm64' }}

integration-test-pass:
runs-on: ubuntu-latest
needs: [integration-test]
steps:
- name: Leave Actions Run Comment
uses: actions/github-script@v6
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = both build and itest completed successfully ✅. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});

retest-integration-pass:
runs-on: ubuntu-latest
needs: [retest-integration]
steps:
- name: Leave Actions Run Comment
uses: actions/github-script@v6
with:
script: |
const runURL = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${{ github.run_id }}`;
const commentBody = `retest Integration: All tests pass ✅. \n[View Actions Run](${runURL}).`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

<io.reactiverse.plugin.version>1.0.27</io.reactiverse.plugin.version>
<org.apache.maven.plugins.compiler.version>3.11.0</org.apache.maven.plugins.compiler.version>
<org.apache.maven.plugins.surefire.version>3.1.2</org.apache.maven.plugins.surefire.version>
<org.apache.maven.plugins.surefire.version>3.2.1</org.apache.maven.plugins.surefire.version>
<org.apache.maven.plugins.failsafe.version>${org.apache.maven.plugins.surefire.version}</org.apache.maven.plugins.failsafe.version>
<org.apache.maven.plugins.site.version>3.12.1</org.apache.maven.plugins.site.version>
<org.apache.maven.plugins.info.reports.version>3.4.5</org.apache.maven.plugins.info.reports.version>
Expand All @@ -78,7 +78,7 @@
<org.codehaus.mojo.exec.plugin.version>3.1.0</org.codehaus.mojo.exec.plugin.version>
<org.codehaus.mojo.build.helper.plugin.version>3.4.0</org.codehaus.mojo.build.helper.plugin.version>
<com.mycila.license.maven.plugin.version>4.3</com.mycila.license.maven.plugin.version>
<org.owasp.dependency.check.version>8.4.0</org.owasp.dependency.check.version>
<org.owasp.dependency.check.version>8.4.2</org.owasp.dependency.check.version>
<com.google.cloud.tools.jib.maven.plugin.version>3.4.0</com.google.cloud.tools.jib.maven.plugin.version>

<!-- Use a separate property for dependency alignment purposes. -->
Expand Down
2 changes: 1 addition & 1 deletion src/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.17-1.1696520331
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.17-2

USER root

Expand Down
2 changes: 1 addition & 1 deletion web-client
Submodule web-client updated 97 files
+0 −3 jest.config.js
+13 −15 package.json
+12 −17 src/app/AppLayout/AppLayout.tsx
+5 −5 src/app/AppLayout/SslErrorModal.tsx
+4 −4 src/app/Archives/Archives.tsx
+7 −6 src/app/CreateRecording/CustomRecordingForm.tsx
+7 −5 src/app/CreateRecording/SnapshotRecordingForm.tsx
+5 −7 src/app/Dashboard/Charts/jfr/JFRMetricsChartCard.tsx
+3 −3 src/app/Dashboard/Dashboard.tsx
+5 −5 src/app/Dashboard/DashboardSolo.tsx
+4 −5 src/app/Events/EventTemplates.tsx
+7 −7 src/app/Events/Events.tsx
+1 −2 src/app/QuickStarts/QuickStartsCatalogPage.tsx
+4 −6 src/app/Recordings/ActiveRecordingsTable.tsx
+4 −4 src/app/Recordings/Recordings.tsx
+4 −4 src/app/Rules/CreateRule.tsx
+4 −5 src/app/Rules/Rules.tsx
+6 −7 src/app/SecurityPanel/Credentials/StoreCredentials.tsx
+1 −1 src/app/SecurityPanel/ImportCertificate.tsx
+4 −4 src/app/Settings/Settings.tsx
+5 −2 src/app/Shared/Components/FileUploads.tsx
+5 −0 src/app/Shared/Components/JmxAuthDescription.tsx
+7 −7 src/app/Topology/Actions/CreateTarget.tsx
+6 −6 src/app/Topology/Actions/NodeActions.tsx
+7 −7 src/app/Topology/Actions/QuickSearchPanel.tsx
+5 −5 src/app/Topology/Actions/WarningResolver.tsx
+2 −2 src/app/Topology/Actions/quicksearches/custom-target.tsx
+2 −2 src/app/Topology/Actions/types.ts
+8 −8 src/app/Topology/Actions/utils.tsx
+2 −3 src/app/Topology/Entity/utils.tsx
+1 −2 src/app/Topology/Toolbar/DisplayOptions.tsx
+1 −2 src/app/Topology/Topology.tsx
+31 −40 src/app/routes.tsx
+3 −3 src/app/utils/utils.ts
+7 −13 src/test/About/About.test.tsx
+12 −21 src/test/Agent/AgentLiveProbes.test.tsx
+25 −11 src/test/Agent/AgentProbeTemplates.test.tsx
+15 −20 src/test/Archives/AllArchivedRecordingsTable.test.tsx
+21 −22 src/test/Archives/AllTargetsArchivedRecordingsTable.test.tsx
+9 −26 src/test/Archives/Archives.test.tsx
+11 −11 src/test/Archives/__snapshots__/Archives.test.tsx.snap
+0 −247 src/test/Common.tsx
+39 −29 src/test/CreateRecording/CustomRecordingForm.test.tsx
+44 −26 src/test/CreateRecording/SnapshotRecordingForm.test.tsx
+73 −15 src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCard.test.tsx
+11 −17 src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisCardList.test.tsx
+52 −25 src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigDrawer.test.tsx
+21 −5 src/test/Dashboard/AutomatedAnalysis/AutomatedAnalysisConfigForm.test.tsx
+26 −6 src/test/Dashboard/AutomatedAnalysis/ClickableAutomatedAnalysisLabel.test.tsx
+97 −43 src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisNameFilter.test.tsx
+23 −5 src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisScoreFilter.test.tsx
+97 −43 src/test/Dashboard/AutomatedAnalysis/Filters/AutomatedAnalysisTopicFilter.test.tsx
+95 −117 src/test/Dashboard/Charts/jfr/JFRMetricsChartCard.test.tsx
+34 −38 src/test/Dashboard/Charts/mbean/MBeanMetricsChartCard.test.tsx
+4 −24 src/test/Dashboard/Dashboard.test.tsx
+11 −18 src/test/Dashboard/DashboardLayoutToolbar.test.tsx
+242 −0 src/test/Dashboard/__snapshots__/DashboardLayoutToolbar.test.tsx.snap
+72 −22 src/test/DateTimePicker/DateTimePicker.test.tsx
+21 −7 src/test/DateTimePicker/MeridiemPicker.test.tsx
+69 −37 src/test/DateTimePicker/TimePicker.test.tsx
+55 −12 src/test/DateTimePicker/TimezonePicker.test.tsx
+112 −33 src/test/Events/EventTemplates.test.tsx
+32 −15 src/test/Events/EventTypes.test.tsx
+92 −30 src/test/RecordingMetadata/BulkEditLabels.test.tsx
+61 −19 src/test/RecordingMetadata/ClickableLabel.test.tsx
+53 −21 src/test/RecordingMetadata/LabelCell.test.tsx
+150 −19 src/test/RecordingMetadata/RecordingLabelFields.test.tsx
+158 −88 src/test/Recordings/ActiveRecordingsTable.test.tsx
+210 −136 src/test/Recordings/ArchivedRecordingsTable.test.tsx
+51 −6 src/test/Recordings/Filters/DatetimeFilter.test.tsx
+113 −54 src/test/Recordings/Filters/DurationFilter.test.tsx
+109 −26 src/test/Recordings/Filters/LabelFilter.test.tsx
+87 −26 src/test/Recordings/Filters/NameFilter.test.tsx
+63 −23 src/test/Recordings/Filters/RecordingStateFilter.test.tsx
+184 −129 src/test/Recordings/RecordingFilters.test.tsx
+29 −15 src/test/Recordings/RecordingLabelsPanel.test.tsx
+54 −25 src/test/Recordings/Recordings.test.tsx
+193 −121 src/test/Recordings/RecordingsTable.test.tsx
+10 −10 src/test/Recordings/__snapshots__/Recordings.test.tsx.snap
+75 −19 src/test/Rules/CreateRule.test.tsx
+114 −37 src/test/Rules/Rules.test.tsx
+91 −11 src/test/SecurityPanel/Credentials/StoreCredentials.test.tsx
+42 −14 src/test/Settings/AutoRefresh.test.tsx
+12 −10 src/test/Settings/AutomatedAnalysisConfig.test.tsx
+21 −3 src/test/Settings/CredentialsStorage.test.tsx
+31 −4 src/test/Settings/DatetimeControl.test.tsx
+42 −14 src/test/Settings/DeletionDialogControl.test.tsx
+21 −3 src/test/Settings/FeatureLevels.test.tsx
+41 −5 src/test/Settings/Language.test.tsx
+52 −15 src/test/Settings/NotificationControl.test.tsx
+63 −23 src/test/Settings/Settings.test.tsx
+21 −3 src/test/Settings/Theme.test.tsx
+32 −13 src/test/Settings/WebSocketDebounce.test.tsx
+22 −7 src/test/Shared/Components/LoadingView.test.tsx
+41 −5 src/test/TargetView/TargetSelect.test.tsx
+149 −0 src/test/utils.tsx
+190 −448 yarn.lock
Loading