amosproj / amos2022ss05-find-my-hearing-aid

MIT License
2 stars 1 forks source link

Set Up CI pipeline as discussed with Sebastian (IP) #30

Closed Meisterlu closed 2 years ago

Meisterlu commented 2 years ago

User story

  1. As a SD
  2. I want / need a CI pipeline
  3. So that we ensure a correct compilation and testing of the code by the end of sprint3

Acceptance criteria

Chippelius commented 2 years ago

We have two problems with the branch protection:

  1. We (or at least I) don't have access to these settings, seems like we would need a role with even more rights
  2. Even if we had access, protected branches are only available to Pro, Team, and Enterprise users

I think, this means we have to omit the "Main branch protection" acceptance criterion and rely on our team sticking to the rules. @Meisterlu @codingwithelijah

codingwithelijah commented 2 years ago

Hi @Chippelius:

Regarding 2.: That shouldn´t be a problem, as students are able to upgrade to Pro for free. That´s the only reason why I am Pro as well :) Regarding 1.: I don´t know if we are able to get more rights. According to Prof. Riehle´s e-mail yesterday, I´m not sure if we will get these rights.

I would leave it up to you whether you try to get the missing rights or whether you just rely on team-intern rules. If you decide to go for the second one, please communicate it clearly to the rest of the team.

image
Chippelius commented 2 years ago

I now also have GitHub Pro, but sadly, I still cannot setup branch protection rules. For this reason and because I have faith in my team, I will try to stick with communicating it clearly for now.

Chippelius commented 2 years ago

There are multiple options for creating unit tests in C#. The ones I am aware of, which are the ones suggested by Visual Studio when setting up a unit test project, are: MSTest, NUnit, and xUnit. We decided to go for MSTest by Microsoft in order to try and stay within only one ecosystem, as Xamarin and Visual Studio are also by them. @NicoStellwag Is this compatible with the SonarCloud solution you are working on for Issue #29 ? (Maybe have a look at the pull-request linked above for reference.)

Chippelius commented 2 years ago

Also, in order to be able to unit-test components that use Xamarin dependencies, a "mocking"-technique is required that lets the component think all of these depencies are there without having to run the whole Xamarin application on actual target platform. This problem is described here in the first paragraph: http://jonathanpeppers.com/Blog/mocking-xamarin-forms The author also presents a solution to this problem, which is a mocking library intended for solving the exact problem we had trying to set up the unit tests: https://github.com/jonathanpeppers/Xamarin.Forms.Mocks / https://www.nuget.org/packages/Xamarin.Forms.Mocks/ This library is released under the MIT license and therefore suitable for our project. My question to @Meisterlu and @codingwithelijah is now: What would be the right time and way of adding this new dependency to our planning documents? Before or after the sprint review (or during)? Or as soon as the merge request into the dev-branch is accepted (which is the point where it becomes a "permanent" addition to the current sprint's release candidate)? I am also asking for future reference, because this is likely to not be the last dependency we will add to this project.

Chippelius commented 2 years ago

@NicoStellwag I just saw your standup mail about having implementing unit tests and intending to add more. Since we were tasked with adding unit-tests that work with the CI-Pipeline, we also had to add some. So please check the pull request linked above for compatibility with your implementation!

NicoStellwag commented 2 years ago

Hi Leo,

thanks for the info! Before implementing we had a look at your branch to make sure we would use the same testing framework, so we should be fine. 👍 A brief additional info for all developers: For the mocking of "backend" services we went with Moq (which is the de facto standard solution for C# as far as I know). We might want to keep that consistent for the whole code base as well.

See you all on Wednesday! :)

Leo Köberlein @.***> schrieb am So., 15. Mai 2022, 23:52:

@NicoStellwag https://github.com/NicoStellwag I just saw your standup mail about having implementing unit tests and intending to add more. Since we were tasked with adding unit-tests that work with the CI-Pipeline, we also had to add some. So please check the pull request linked above for compatibility with your implementation!

— Reply to this email directly, view it on GitHub https://github.com/amosproj/amos2022ss05-find-my-hearing-aid/issues/30#issuecomment-1127055332, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANGXC5LHVDH6YKHF66BAATLVKFW2LANCNFSM5VRZM44Q . You are receiving this because you were mentioned.Message ID: @.*** com>

Meisterlu commented 2 years ago

@Chippelius You can add the dependency right now (so before the team meeting). Just make sure everybody is aware of the change. From our side all fine