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

Test native libraries using docker for multiple distros #1921

Merged
merged 2 commits into from
Nov 14, 2021

Conversation

arturcic
Copy link
Contributor

@arturcic arturcic commented Nov 4, 2021

Adds a test project that references the LibGit2Sharp.
Adds a native-test GitHub workflow that builds and the runs the test project to test the native libraries are loaded properly
This test project is build inside a docker image and the the docker image is run

Dockerfile Outdated Show resolved Hide resolved
@arturcic
Copy link
Contributor Author

arturcic commented Nov 4, 2021

@bording may you have a look on this PR?

@bording
Copy link
Member

bording commented Nov 9, 2021

This PR has some interesting ideas, but it's clear that it's been ported over from another repo (GitVersion?), so it has things that we don't need if we're actually part of this repo.

Thoughts while looking at the PR:

  • There's no need for a separate solution. The test project should be part of the main solution.
  • There's no need to customize the version of the native binaries package. It should just run against whatever version the main project is referencing.
  • Do we even need a separate load check project? I'm wondering if it would be a good idea to instead run the entire test suite, triggering whenever a CI workflow is run.

Thoughts?

@arturcic
Copy link
Contributor Author

arturcic commented Nov 9, 2021

Thoughts while looking at the PR:

  • There's no need for a separate solution. The test project should be part of the main solution.
    Agree, I can move it under the main solution.
  • There's no need to customize the version of the native binaries package. It should just run against whatever version the main project is referencing.

This was needed at the time the NativeLibraries was not published to nuget and that was the reason in the PR for the NativeLibraries I included publishing to GitHub Packages.

  • Do we even need a separate load check project? I'm wondering if it would be a good idea to instead run the entire test suite, triggering whenever a CI workflow is run.
    I can have a look on what can be done, as the Docker images I used to test, contain the dotnet sdk, and that means we can run the dotnet test there. It might take some time to run all the images and all the tests so in that case I suggest to run it in a separate flow, and not the main one, but that is something you need to decide

@arturcic
Copy link
Contributor Author

arturcic commented Nov 9, 2021

This PR has some interesting ideas, but it's clear that it's been ported over from another repo (GitVersion?), so it has things that we don't need if we're actually part of this repo.

That is true, I use the same docker images to test GitVersion (including LibGit2Sharp part of GitVersion). but the Docker images are just the base images of each distro, with the dotnet sdk/runtime native dependencies for each distro, and on top of that the .net sdk/runtime installed depending on the selected version. So basically the images contain only dotnet and the dependencies needed to run dotnet. There is no GitVersion specific packages/code there.

@arturcic
Copy link
Contributor Author

@bording I reworked the PR. Now the tests are run inside of docker containers for several distros and .net versions. Unfortunately I had to disable te arm64 jobs as they run for quite a long of time. If you don't mind we keep only the amd64 jobs for now I can later check how to enable in another PR.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@arturcic arturcic force-pushed the feature/test-native branch 4 times, most recently from 474472e to 5101c89 Compare November 13, 2021 14:50
@bording bording merged commit 4daf618 into libgit2:master Nov 14, 2021
@bording
Copy link
Member

bording commented Nov 14, 2021

Thanks for the PR. Eventually I think want to move to use docker images that are in this repo to give a bit more control. For example, I'd prefer to always use the latest SDK, and then have additional runtimes installed as needed for the tests.

That can be done later, and this is a great first step!

@arturcic arturcic deleted the feature/test-native branch November 17, 2021 09:49
matt-richardson added a commit to OctopusDeploy/OctoVersion that referenced this pull request Jan 19, 2022
To hopefully get the version that has native libaries pulled in nicely. Relates to libgit2/libgit2sharp#1921
matt-richardson added a commit to OctopusDeploy/OctoVersion that referenced this pull request Jan 19, 2022
To get the version that has native libaries pulled in nicely. Relates to libgit2/libgit2sharp#1921
edlyn-liew pushed a commit to OctopusDeploy/OctoVersion that referenced this pull request Jun 3, 2024
To get the version that has native libaries pulled in nicely. Relates to libgit2/libgit2sharp#1921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants