fsprojects / FAKE

FAKE - F# Make
https://fake.build
Other
1.28k stars 581 forks source link

Fix getLastTag #2681

Closed akhansari closed 1 year ago

akhansari commented 2 years ago

Description

yazeedobaid commented 2 years ago

Hi thanks for the PR Could you please rebase your branch from release/next? Now that the build has been fixed.

akhansari commented 1 year ago

Hi @yazeedobaid, it should be ok now.

yazeedobaid commented 1 year ago

Thanks for the fix Do u have any suggestions on how to add tests to the Git module? For example, maybe we should have a test fixture repository with sample commits/branches/tags and write tests against it?

akhansari commented 1 year ago

Maybe it could be some integration tests running inside a container.

Each test creates an unique temp folder and initializes git. Then it arranges with some commits, for instance. And finally it runs the test logic.

Wdyt?

yazeedobaid commented 1 year ago

Yes, an integration test, the steps you mentioned will be sufficient to cover the logic. But one question, why u need a container for that? Why not initialize a temporary folders and repositories, run the tests and then delete them. This way is somehow similar to what a test against a database is like. You initialize the database before each test and after each test turn it down. Can u give more info about the container approach?

akhansari commented 1 year ago

Because usually CI runners don't have all necessary infrastructure with different setup or versions (here it's git and dotnet) to be able to run integration tests and to keep runners clean. So service containers are used for these kind of cases.

But I'm not very familiar with github (I know gitlab better). Maybe what I'm saying is too much regarding our case.

yazeedobaid commented 1 year ago

To my knowledge, service containers are used to hook up with another service instead of managing it in the CI pipeline. So for example running tests against multiple databases. Instead of manually installing the different database services and managing them, you can use service containers to do that for you.

We can use them for tests, but in my opinion, they will be overkill in our case. And if we went with this approach the service container will be used to test GIT-related code. And for other parts of the FAKE repo, we maybe need to set up another container.

Or maybe we can use a general container and test against it? I don't have much information/details about the best way to use service containers, but if we can use them in a way that will make it easy to develop/test/use/maintain then I'm ok with it. What do you think?

akhansari commented 1 year ago

You're right, when I read the documentation, what you said makes sense and service containers are not the right way. 💭