Skip to content

Add support for building on Jenkins. (#4159) - #4180

Merged
rolfbjarne merged 8 commits into
dotnet:d15-8from
rolfbjarne:jenkinsfile-d15-8
Jun 7, 2018
Merged

Add support for building on Jenkins. (#4159)#4180
rolfbjarne merged 8 commits into
dotnet:d15-8from
rolfbjarne:jenkinsfile-d15-8

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Add support for building on internal Jenkins.

Jenkins has been configured to build every branch on xamarin/xamarin-macios that contains a jenkins/Jenkinsfile, which means it will start working as soon as this PR is merged.

Results will be posted as statuses on each commit, which can be viewed using the url https://github.com/xamarin/xamarin-macios/commits/<branch>:

screenshot 2018-06-01 11 12 57

  • The continuous-integration/jenkins/branch status links to the jenkins job.
  • The other two are XI and XM packages (the Jenkins- prefix will be removed once we officially switch from Wrench to Jenkins).

More detailed information will be added as a comment to each commit, which can be seen by clicking on the commit and scrolling to the bottom (url of the format https://github.com/xamarin/xamarin-macios/commit/<sha1>)

screenshot 2018-06-01 11 14 33

Unfortunately GitHub does not display the commit statuses when viewing a single commit, so to view those statuses you'll have to view the list of commits (the /commits/ url). Tip: it's possible to use <sha1> instead of <branch> (and vice versa for that matter) if you're interested in the statuses of a particular commit.

Pull requests will also be built (only from contributors with write access), but by default nothing will be done (the job will exit immediately, although a green check mark will still show up). Jenkins will not add a comment in the pull request in this case.

However, if the label build-package [1] is set for a pull request, the internal jenkins job will run (it will do everything except the local xharness test run: this includes creating and publishing packages, creating various diffs, run tests on older macOS versions, test docs, etc). A detailed comment will also be added to the pull request (see below for multiple examples), which means that there will be two Jenkins comments: one for the public Jenkins which builds every PR, and one for the internal Jenkins [2].

[1] I don't quite like the name of the label, because it doesn't get even close to explain all that will actually happen, but run-on-internal-jenkins-and-create-package is a bit too long IMHO... Also it's non-obvious that this is the label to apply if the reason for executing on the internal jenkins is some other reason (for instance to test a maccore bump). Other ideas:

  • run-internal-jenkins: doesn't make it obvious that a package will be created (which is probably the most common reason to want to run on internal jenkins)
  • We could have multiple labels that mean the same thing: build-package, internal-build, run-internal-jenkins, etc, but it's redundant and I don't quite like it either.
  • Any other ideas?

[2] I'm noticing now that these two look quite similar and this might end up confusing (the main difference is that the comment from the public jenkins will say Build success/failure and Build comment file: at the top. If something goes wrong the failure will also show up differently). Should this be made clearer?

Add support for building on internal Jenkins.

Jenkins has been configured to build every branch on xamarin/xamarin-macios that contains a `jenkins/Jenkinsfile`, which means it will start working as soon as this PR is merged.

Results will be posted as statuses on each commit, which can be viewed using the url `https://github.com/xamarin/xamarin-macios/commits/<branch>`:

![screenshot 2018-06-01 11 12 57](https://user-images.githubusercontent.com/249268/40832932-c3b05eb0-658c-11e8-9670-8de5fcc23407.png)

* The `continuous-integration/jenkins/branch` status links to the jenkins job.
* The other two are XI and XM packages (the `Jenkins-` prefix will be removed once we officially switch from Wrench to Jenkins).

More detailed information will be added as a comment to each commit, which can be seen by clicking on the commit and scrolling to the bottom (url of the format `https://github.com/xamarin/xamarin-macios/commit/<sha1>`)

![screenshot 2018-06-01 11 14 33](https://user-images.githubusercontent.com/249268/40833014-fd8772f4-658c-11e8-8a35-5df46bfb16c7.png)

Unfortunately GitHub does not display the commit statuses when viewing a single commit, so to view those statuses you'll have to view the list of commits (the `/commits/` url). Tip: it's possible to use `<sha1>` instead of `<branch>` (and vice versa for that matter) if you're interested in the statuses of a particular commit.

Pull requests will also be built (only from contributors with write access), but by default nothing will be done (the job will exit immediately, although a green check mark will still show up). Jenkins will **not** add a comment in the pull request in this case.

However, if the label `build-package` [1] is set for a pull request, the internal jenkins job will run (it will do everything except the local xharness test run: this includes creating and publishing packages, creating various diffs, run tests on older macOS versions, test docs, etc). A detailed comment will also be added to the pull request (see below for multiple examples), which means that there will be two Jenkins comments: one for the public Jenkins which builds every PR, and one for the internal Jenkins [2].

[1] I don't quite like the name of the label, because it doesn't get even close to explain all that will actually happen, but `run-on-internal-jenkins-and-create-package` is a bit too long IMHO... Also it's non-obvious that this is the label to apply if the reason for executing on the internal jenkins is some other reason (for instance to test a maccore bump). Other ideas:

* `run-internal-jenkins`: doesn't make it obvious that a package will be created (which is probably the most common reason to want to run on internal jenkins)
* We could have multiple labels that mean the same thing: `build-package`, `internal-build`, `run-internal-jenkins`, etc, but it's redundant and I don't quite like it either.
* Any other ideas?

[2] I'm noticing now that these two look quite similar and this might end up confusing (the main difference is that the comment from the public jenkins will say **Build success/failure** and **Build comment file:** at the top. If something goes wrong the failure will also show up differently). Should this be made clearer?
@rolfbjarne rolfbjarne added the build-package Build (and create package) on internal Jenkins. Apply 'run-internal-tests' to run tests too. label Jun 4, 2018
@spouliot spouliot added this to the d15-8 milestone Jun 5, 2018
@rolfbjarne

Copy link
Copy Markdown
Member Author

🔥 Jenkins job (on internal Jenkins) failed in stage 'Running XM tests on '10.7'' 🔥 : hudson.AbortException: script returned exit code 2

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.
🔥 Xamarin.Mac tests on 10.10 failed 🔥
🔥 Xamarin.Mac tests on 10.8 failed 🔥
🔥 Xamarin.Mac tests on 10.9 failed 🔥
🔥 Xamarin.Mac tests on 10.7 failed 🔥

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure
Build comment file:

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
🔥 Test run failed 🔥

Test results

1 tests failed, 0 tests skipped, 79 tests passed.

Failed tests

  • MSBuild tests/iOS: Failed (Execution failed with exit code 21)

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure
Build comment file:

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
🔥 Test run failed 🔥


@rolfbjarne

Copy link
Copy Markdown
Member Author

🔥 Jenkins job (on internal Jenkins) failed in stage 'Running XM tests on '10.8'' 🔥 : hudson.AbortException: script returned exit code 2

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.
🔥 Xamarin.Mac tests on 10.7 failed 🔥
🔥 Xamarin.Mac tests on 10.10 failed 🔥
🔥 Xamarin.Mac tests on 10.9 failed 🔥
🔥 Xamarin.Mac tests on 10.8 failed 🔥

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure
Build comment file:

🔥 Build failed 🔥


@rolfbjarne

Copy link
Copy Markdown
Member Author

🔥 Jenkins job (on internal Jenkins) failed in stage 'Provisioning' 🔥 : hudson.AbortException: script returned exit code 1

🔥 Provisioning failed 🔥

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure

!!! Couldn't read commit file !!!

@rolfbjarne

Copy link
Copy Markdown
Member Author

🔥 Jenkins job (on internal Jenkins) failed in stage 'Running XM tests on '10.12'' 🔥 : hudson.AbortException: script returned exit code 2

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.
🔥 Xamarin.Mac tests on 10.10 failed 🔥
🔥 Xamarin.Mac tests on 10.7 failed 🔥
🔥 Xamarin.Mac tests on 10.9 failed 🔥
🔥 Xamarin.Mac tests on 10.8 failed 🔥
🔥 Xamarin.Mac tests on 10.12 failed 🔥

@rolfbjarne

Copy link
Copy Markdown
Member Author

Jenkins job (on internal Jenkins) succeeded

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.

@monojenkins

Copy link
Copy Markdown
Contributor

Build failure
Build comment file:

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
🔥 Test run failed 🔥

Test results

1 tests failed, 0 tests skipped, 79 tests passed.

Failed tests

  • MSBuild tests/iOS: Failed (Execution failed with exit code 21)

Quoting empty CONFIGURE_FLAGS ends up doing this:

    ./configure "" --disable-ios-device

and since configure parses arguments until it finds an empty argument, it
would stop parsing at the first argument, effectively not disabling the device
build.

So don't quote CONFIGURE_FLAGS when invoking configure. shellcheck doesn't
quite like this, but the better code is much more complex, and not really
needed, so just add an exception.
@rolfbjarne

Copy link
Copy Markdown
Member Author

Jenkins job (on internal Jenkins) succeeded

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
ℹ️ Test run skipped: Not running tests here because they're run on public Jenkins.

@monojenkins

Copy link
Copy Markdown
Contributor

Build success
Build comment file:

Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (only version changes)
Test run succeeded


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

Labels

build-package Build (and create package) on internal Jenkins. Apply 'run-internal-tests' to run tests too.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants