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: add missing conditionals to optional jobs in test rock #299

Merged
merged 23 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7044098
fix: add missing test job conditionals
clay-lake Dec 2, 2024
cfd1328
test: disable all test-rock jobs
clay-lake Dec 2, 2024
1f82d14
fix: test malware job name
clay-lake Dec 2, 2024
e582a9f
fix: add mising paramters
clay-lake Dec 2, 2024
4a2b212
test: enable singular test job
clay-lake Dec 2, 2024
d12f488
test: enable all test jobs
clay-lake Dec 2, 2024
f6bccad
test: comment out test job again
clay-lake Dec 2, 2024
3957c4a
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Dec 2, 2024
7fd4be7
Merge branch 'fix_optional_test-rock_jobs' of https://github.com/cano…
clay-lake Dec 2, 2024
fe1870e
fix: github conditionals must test str not bool
clay-lake Dec 2, 2024
659ff7e
test: execute with all tests
clay-lake Dec 2, 2024
535c3f1
fix(Test-Rock.yaml): bad default values
clay-lake Dec 2, 2024
06a15b3
test: enable test-efficiency
clay-lake Dec 2, 2024
35c55ae
revert convertion of default to string
clay-lake Dec 2, 2024
cc965b1
test: suggestion on formatting if expr
clay-lake Dec 2, 2024
04bfcbc
test: boolean directly
clay-lake Dec 2, 2024
d60d5ee
fix: Test-Rock workflow conditionals
clay-lake Dec 2, 2024
4ea9ad8
fix: reconfigure deafult self tests
clay-lake Dec 2, 2024
366a0f7
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Dec 2, 2024
04b5f00
Merge branch 'main' into fix_optional_test-rock_jobs
clay-lake Dec 3, 2024
fc455d4
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Dec 3, 2024
1120b2b
Merge branch 'main' into fix_optional_test-rock_jobs
clay-lake Dec 4, 2024
651241f
ci: automatically update oci/mock-rock/_releases.json, from https://g…
Dec 4, 2024
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
25 changes: 18 additions & 7 deletions .github/workflows/Test-Rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ on:
default: true
type: boolean

## Rock black-box Test
test-black-box:
description: "Enable rock black-box test."
default: true
type: boolean

## Image Efficiency Test
test-efficiency:
description: "Enable image efficiency test."
Expand All @@ -34,7 +40,7 @@ on:
type: string

## Malware Test
test_malware:
test-malware:
description: "Enable malware test."
default: true
type: boolean
Expand Down Expand Up @@ -75,8 +81,8 @@ jobs:
ref: ${{ steps.workflow-version.outputs.sha }}
fetch-depth: 1

# download and unpacks the image under test, then store it under a common cache key.
# This unpacked image is used in test-oci-compliance and test_malware jobs
# download and unpack the image under test, then store it under a common cache key.
# This unpacked image is used in test-oci-compliance, test-black-box and test-malware jobs
- name: Download Rock
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -105,6 +111,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-oci-compliance ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: inputs.test-oci-compliance
steps:
- uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -132,6 +139,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: "test-black-box ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: inputs.test-black-box
steps:
- uses: actions/cache/restore@v4
with:
Expand All @@ -146,22 +154,23 @@ jobs:
copy oci:${{ env.TEST_IMAGE_NAME }}:${{ env.TEST_IMAGE_TAG }} \
docker-daemon:${{ env.TEST_IMAGE_NAME }}:${{ env.TEST_IMAGE_TAG }}

- name: Create container
run: |
docker create ${{ env.TEST_IMAGE_NAME }}:${{ env.TEST_IMAGE_TAG }}

- name: Test rock
run: |
set -ex
docker run --rm ${{ env.TEST_IMAGE_NAME }}:${{ env.TEST_IMAGE_TAG }} \
help | grep Pebble

- name: Create container
run: |
docker create ${{ env.TEST_IMAGE_NAME }}:${{ env.TEST_IMAGE_TAG }}

test-efficiency:
runs-on: ubuntu-22.04
name: "test-efficiency ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
# TODO: remove once https://chat.charmhub.io/charmhub/pl/o5wxpb65ffbfzy7bcmi8kzftzy is fixed
continue-on-error: true
if: inputs.test-efficiency
steps:

- name: Cloning OCI Factory
Expand Down Expand Up @@ -199,6 +208,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-vulnerabilities ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: inputs.test-vulnerabilities
steps:

- name: Cloning OCI Factory
Expand Down Expand Up @@ -265,6 +275,7 @@ jobs:
runs-on: ubuntu-22.04
name: "test-malware ${{ inputs.oci-archive-name != '' && format('| {0}', inputs.oci-archive-name) || ' '}}"
needs: [configure-tests]
if: inputs.test-malware
steps:
- name: Cloning OCI Factory
uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/Vulnerability-Scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ jobs:
with:
oci-archive-name: ${{ needs.configure-scan.outputs.oci-image }}
test-vulnerabilities: true # just incase we set this to false by default in the future
test-oci-compliance: false
test-black-box: false
test-efficiency: false
test_malware: false
test-malware: false
test-oci-compliance: false

parse-results:
name: "parse-results ${{ inputs.oci-image-name != '' && format('| {0}', inputs.oci-image-name) || ' '}}"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/_Test-OCI-Factory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ jobs:
# needs: [build-rock]
# with:
# oci-archive-name: "mock-rock"
# test-vulnerabilities: true
# test-oci-compliance: true
# test-black-box: true
# test-efficiency: true
# test_malware: true
# test-malware: true
# test-oci-compliance: true
# test-vulnerabilities: true


# # Test workflow used in continuous testing
# test-vulnerability-scan:
Expand Down
14 changes: 7 additions & 7 deletions oci/mock-rock/_releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@
"1.1-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"candidate": {
"target": "921"
"target": "942"
},
"beta": {
"target": "921"
"target": "942"
},
"edge": {
"target": "921"
"target": "942"
}
},
"1-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"candidate": {
"target": "921"
"target": "942"
},
"beta": {
"target": "921"
"target": "942"
},
"edge": {
"target": "921"
"target": "942"
}
},
"1.2-22.04": {
"end-of-life": "2030-05-01T00:00:00Z",
"beta": {
"target": "922"
"target": "943"
},
"edge": {
"target": "1.2-22.04_beta"
Expand Down