RFR: SKARA-758: Add /check pull request command

Robin Westberg rwestberg at openjdk.java.net
Wed Nov 25 13:08:57 UTC 2020


On Wed, 25 Nov 2020 12:26:18 GMT, Kartik Ohri <github.com+27751938+amCap1712 at openjdk.org> wrote:

>> Sure, let's start with the required setup for running tests against GitHub (or GitLab) then! You can pass `-Pcredentials=/path/to/credentials.json` where the file contains something like this:
>> 
>> {
>>     "type": "github",
>>     "host": "https://github.com",
>>     "project": "rwestberg/skara-integration",
>>     "namespace": "github.com",
>>     "apps": [
>>         {
>>             "key": "certificates/sbot.private-key.pkcs8.pem",
>>             "id": "12837",
>>             "installation": "195957"
>>         },
>>         {
>>             "key": "certificates/sbot2.private-key.pkcs8.pem",
>>             "id": "18848",
>>             "installation": "379295"
>>         },
>>         {
>>             "key": "certificates/sbot3.private-key.pkcs8.pem",
>>             "id": "19394",
>>             "installation": "397926"
>>         }
>>     ]
>> }
>> 
>> Most tests require two or three different accounts in order to simulate various interactions, so that's why there are a list of them. Each account credential corresponds to a GitHub app that you can create on your account. The `id` can be seen after creating the app, the `installation` value can be found after the app is installed on your account. Finally, the key is the private key you associate with the GitHub app. The path is relative to the .json file. Note that it has to be in PEM format, you'll have to convert the file you get from GitHub.
>
> I have created the 3 Github Apps and generated the .json file as you instructed. How should I proceed ?

Now you can use the credentials file when running the tests through Gradle, probably something like this (I usually run from IntelliJ):

`sh gradlew --tests *testCheckRun* -Pcredentials=/path/to/credentials.json`

-------------

PR: https://git.openjdk.java.net/skara/pull/954


More information about the skara-dev mailing list