Feature #5327
closedone modulepar to differentiate between nightly and latest
100%
Description
New Osmocom releases were just made, and related modulepar variables needed to be adjusted/removed in osmo-ttcn3-hacks as well as docker-playground:
docker-playground.git:- https://gerrit.osmocom.org/c/docker-playground/+/26009
- https://gerrit.osmocom.org/c/docker-playground/+/26296
- https://gerrit.osmocom.org/c/docker-playground/+/26297
- https://gerrit.osmocom.org/c/docker-playground/+/26298
- https://gerrit.osmocom.org/c/docker-playground/+/26299
- https://gerrit.osmocom.org/c/docker-playground/+/26300
- https://gerrit.osmocom.org/c/docker-playground/+/26325
- https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26295
- https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26301
- https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26302
- https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26303
- create one modulepar variable that indicates whether nightly or latest is used (in a libarary, so it's available in all testsuites)
- adjust docker-playground to set this for all projects once
- with each new release, we only drop the if() {} around statements that were exclusively running for nightly, but keep the variable
if (mp_is_nightly) { extra code }
Then we need no changes in docker-playground.git after the release, and less changes in osmo-ttcn3-hacks.git.
Thoughts?
Updated by laforge over 2 years ago
- Status changed from New to Feedback
looks good to me.
Would be good if that modulepar could somehow be set automatically based on the jenkins job name or something like that, so we don't have to hav sed statements in each job, but only in one location.
One could even go further and introduce a modulepar that specifies the 'build', like a string or an enum that indicates "nightly", 'latest" or in the future "2021q4" or the like. Every time we execute a testsuite, this modulepar gets set by some "magic" and the tests can adjust their behavior, if they so choose.
Updated by pespin over 2 years ago
We can have a separate ttcn3 file/module with that module parameter and a few APIs to simpliify/unify checks.
mp_version_name := "latest"
boolean Osmo_Version.is_nightly();
boolean Osmo_Version.is_latest();
etc.
Bear in mind we'll need to keep some seds since sometimes the changes are required in osmocom program config file, eg osmo-bsc.cfg.
Updated by osmith over 2 years ago
- Status changed from Feedback to In Progress
- % Done changed from 0 to 90
pespin wrote in #note-2:
Bear in mind we'll need to keep some seds since sometimes the changes are required in osmocom program config file, eg osmo-bsc.cfg.
Ah right, so there might be some docker-playground patches even with this change. (Still useful though.)
Implemented based on the suggestions above. I've put it in Misc_Helpers since it fits there too IMHO and we already have that available in most/all? modules.
First user:Updated by osmith over 2 years ago
laforge wrote in #note-1:
Would be good if that modulepar could somehow be set automatically based on the jenkins job name or something like that, so we don't have to hav sed statements in each job, but only in one location.
I just read that comment again. Lines like
write_osmocom_stack_version "$VOL_BASE_DIR/bsc-tester/BSC_Tests.cfg"
are added to each ttcn3-*/*jenkins*.sh.
I think we'd need to have an extra function call in any case in the jenkins.sh file, or else the only place to put that would be in "network_create" possibly. But that would be a hack since the function is for another purpose. The path to the cfg file could be auto-detected (find all .cfg files in VOL_BASE_DIR) if preferred... but I think having that explicitly stated doesn't hurt either.
Updated by osmith over 2 years ago
- Status changed from In Progress to Resolved
- % Done changed from 90 to 100