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

Add test job for crypto repo #123

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Add test job for crypto repo #123

merged 2 commits into from
Dec 6, 2024

Conversation

bensze01
Copy link
Contributor

@bensze01 bensze01 commented Sep 20, 2023

Changes and fixes needed to add test jobs for the crypto repo

Test Runs:

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sensible to me. A few suggestions and one question.

vars/environ.groovy Outdated Show resolved Hide resolved
vars/environ.groovy Outdated Show resolved Hide resolved
vars/psa_crypto.groovy Outdated Show resolved Hide resolved
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, otherwise this looks good to me.

vars/psa_crypto.groovy Outdated Show resolved Hide resolved
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

Copy link
Contributor

@davidhorstmann-arm davidhorstmann-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidhorstmann-arm davidhorstmann-arm added the approved Approved in review. May need additional CI. label Sep 25, 2023

void run_pr_job() {
if (env.TARGET_BRANCH != 'main') {
echo 'PR target is not "main" branch - not building.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we refuse to build pull requests targeting another branch? We don't do it often, but we do do it sometimes, and I don't see any reason to forbid it.

Copy link
Contributor Author

@bensze01 bensze01 Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only main contains the files copied from Mbed-TLS, including all.sh. If we want to test PRs targeting development, a bit more logic is needed - but that was out of scope for the original issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main is the only branch that contains all.sh. The other branches are just templates that don't have everything imported from the mbedtls repo. Once we move crypto development to this repo, this condition should go away.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh jinx

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want to build the 'development' branch (only the build system, doc and tree skeleton) and we have only two maintained branches currently thus this test does the job considering those two branches. Taking into consideration other working branches based on main, if (env.TARGET_BRANCH == 'development') is probably better though.

Copy link
Contributor Author

@bensze01 bensze01 Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronald-cron-arm Yes, the main reason for the check is to prevent jenkins from reporting spurious errors to github.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ronald-cron-arm Yes, the reason for the check is to prevent jenkins from reporting spurious errors to github.

okay, thanks. Then, what about if (env.TARGET_BRANCH == 'development') instead to allow the manual CI testing of "main like" branches.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that works for me as well.

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like a job for fileExists(…) (plus perhaps some content check) rather than checking the target branch name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general probably but currently the development branch in psa-crypto is quite peculiar thus to me it is acceptable for it to be handled in a special manner for CI purposes.

@@ -28,26 +28,23 @@ def set_common_environment() {
env.MAKEFLAGS = '-j2'
}

def set_tls_pr_environment(is_production) {
void set_pr_environment(boolean is_production, String repo='tls') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make repo some kind of enum?

@ronald-cron-arm ronald-cron-arm linked an issue Sep 27, 2023 that may be closed by this pull request
@gilles-peskine-arm gilles-peskine-arm added needs: work and removed approved Approved in review. May need additional CI. labels Oct 4, 2023
@gilles-peskine-arm
Copy link
Contributor

There's a merge conflict now.

@bensze01 bensze01 force-pushed the dev/bensze01/psa-crypto branch from 0191782 to c8f5e7e Compare October 12, 2023 14:04
@bensze01 bensze01 closed this Nov 25, 2024
@bensze01 bensze01 force-pushed the dev/bensze01/psa-crypto branch from a2fdd0f to 4bbc4f6 Compare November 25, 2024 17:20
@bensze01 bensze01 reopened this Nov 25, 2024
@bensze01 bensze01 force-pushed the dev/bensze01/psa-crypto branch from 4834a2d to f751d16 Compare November 25, 2024 17:44
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
@mpg
Copy link
Contributor

mpg commented Dec 4, 2024

@bensze01 Forgot to ask yesterday, regarding the labels: does "needs CI" mean that you want to run more test jobs, or that the test jobs so far revealed issues that need fixing? (From the absence of "needs work" I'm assuming it's the former, I'm just checking to be sure.)

This fixes issues with building commits that are not fetched by the
default refspec of +refs/heads/*:refs/remotes/origin/*, eg. if the
specified commit is not in the history of any extant branch, or when
using shallow clones.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
@bensze01
Copy link
Contributor Author

bensze01 commented Dec 4, 2024

@mpg The former. I pushed a small drive-by fix for an issue that was hindering my testing, but aside from this no further rework should be required.

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me. I'm just waiting for all the test runs before I formally approve.

Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bensze01 bensze01 added the enhancement New feature or request label Dec 5, 2024
@bensze01
Copy link
Contributor Author

bensze01 commented Dec 5, 2024

I've added all of the tests I was planning to run to the PR description.

@bensze01 bensze01 removed the needs: ci label Dec 6, 2024
@bensze01
Copy link
Contributor Author

bensze01 commented Dec 6, 2024

@mpg All the CI runs passed.

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a look at the tests runs, and it all looks good to me. Thanks!

@mpg mpg merged commit d736fff into main Dec 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CI support
6 participants