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

Generate property file with SHA info #2889

Closed
llxia opened this issue Sep 20, 2021 · 4 comments
Closed

Generate property file with SHA info #2889

llxia opened this issue Sep 20, 2021 · 4 comments
Assignees

Comments

@llxia
Copy link
Contributor

llxia commented Sep 20, 2021

Currently, we generate SHA.txt for capture test repo shas. This file is easy to read, but it can not be used directly to set env value.

Maybe it is easier to create a property file with key and value pairs. The key should match with get.sh parameters and values in ant build.xml. For example in testenv.properties file, we have

TKG_REPO=https://github.com/adoptium/TKG.git
TKG_BRANCH=3f1b8746bb6dd25870cac3fc116ad4754ec5d700
JDK_REPO=xxx
JDK_BRANCH=xxx
...

In get.sh, we can simply add source ./testenv.properties to load the variables (i.e., TKG_REPO, TKG_BRANCH, etc).
For ant (build.xml) to work, the variables need to be set as env variables (i.e., JDK_REPO, JDK_BRANCH, etc).

source ./testenv.properties
make compile

or

while read line; do
    export $line
done < testenv.properties
make compile

IMO, option2 seems better as it will cover the local run as well.

In Grinder, add a boolean flag USE_TESTENV_PROPERTIES. If it is set to true, ignore the params in Grinder, read testenv.properties and set values as env variable (override params if set) for ant scripts and run get.sh.
And If the flag is set to true, we are expecting to find the file under root testenv.properties. Print error and exit the build if this file cannot be found. This logic should be in get.sh.
If it is set to false, proceed as a regular run (that is take the parameters from Grinder).

Please test both the local and Grinder run.

Update: broken into several steps:

@psaunderualberta
Copy link
Contributor

I will take this for now, I'll likely end up breaking it into smaller issues like recommended.

@llxia
Copy link
Contributor Author

llxia commented Sep 24, 2021

Thanks @psaunderualberta . Please check meeting recording for details.

For the first issue - generate the testenv.properties file and archive testenv.properties
I think it is easier just update the existing logic of generating SHA.txt :
https://github.com/adoptium/aqa-tests/blob/master/get.sh#L619
https://github.com/adoptium/aqa-tests/blob/master/get.sh#L626
https://github.com/adoptium/TKG/blob/07171520f8b0849d922125d35380d45193f9c5bf/scripts/getSHA.sh

@llxia
Copy link
Contributor Author

llxia commented Oct 5, 2021

preliminary testenv.properties is created: #2921

@sophia-guo sophia-guo changed the title Generate property file with SHA into Generate property file with SHA info Oct 7, 2021
llxia added a commit to llxia/aqa-tests that referenced this issue Dec 14, 2021
Related: adoptium/TKG#255
Related: adoptium#2889

Signed-off-by: lanxia lan_xia@ca.ibm.com
llxia added a commit to llxia/aqa-tests that referenced this issue Dec 14, 2021
Currently, we take both OPENJ9_BRANCH and OPENJ9_SHA. However, in testenv.properties, we only output one value
 - OPENJ9_SHA (adoptium/TKG#255). We will not have branch information. The logic in `get.sh` was highly optimized
 to have minimal checkout for openj9 repo (i.e., we do not fetch other branches). This causes a problem as it is
 not able to git clone with sha only (if the sha is from other branch).

This PR adds the support to git clone personal openj9 sha without branch info, so we can consume the OPENJ9_SHA
without OPENJ9_BRNACH info.

Related: adoptium/TKG#255
Related: adoptium#2889

Signed-off-by: lanxia lan_xia@ca.ibm.com
llxia added a commit to llxia/aqa-tests that referenced this issue Dec 29, 2021
Currently, we take both OPENJ9_BRANCH and OPENJ9_SHA. However, in testenv.properties, we only output one value
 - OPENJ9_SHA (adoptium/TKG#255). We will not have branch information. The logic in `get.sh` was highly optimized
 to have minimal checkout for openj9 repo (i.e., we do not fetch other branches). This causes a problem as it is
 not able to git clone with sha only (if the sha is from other branch).

This PR adds the support to git clone personal openj9 sha without branch info, so we can consume the OPENJ9_SHA
without OPENJ9_BRNACH info.

Related: adoptium/TKG#255
Related: adoptium#2889

Signed-off-by: lanxia lan_xia@ca.ibm.com
smlambert pushed a commit that referenced this issue Dec 30, 2021
Currently, we take both OPENJ9_BRANCH and OPENJ9_SHA. However, in testenv.properties, we only output one value
 - OPENJ9_SHA (adoptium/TKG#255). We will not have branch information. The logic in `get.sh` was highly optimized
 to have minimal checkout for openj9 repo (i.e., we do not fetch other branches). This causes a problem as it is
 not able to git clone with sha only (if the sha is from other branch).

This PR adds the support to git clone personal openj9 sha without branch info, so we can consume the OPENJ9_SHA
without OPENJ9_BRNACH info.

Related: adoptium/TKG#255
Related: #2889

Signed-off-by: lanxia lan_xia@ca.ibm.com
@smlambert
Copy link
Contributor

I believe this one is now addressed, closing as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants