EvotecIT / OfficeIMO

Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
279 stars 49 forks source link

Add VerifyTests #86

Closed rstm-sf closed 3 months ago

rstm-sf commented 1 year ago

Testsing with https://github.com/VerifyTests/Verify

rstm-sf commented 1 year ago

@PrzemyslawKlys hello!

we need to add more tests for cases like this,, to check order of paragraphs objects https://github.com/EvotecIT/OfficeIMO/issues/82#issuecomment-1327748802

I decided to golden tests to make it easier to do refactoring https://youtu.be/wA7oJDyvn4c

Is it possible to change the name of the pipeline?) image

PrzemyslawKlys commented 1 year ago

Hi,

I saw you playing with this, and this is an excellent idea. You will need to add some "how to" so it can be easily regenerated if needed so I can do it myself from time to time ;)

As for the name of the pipeline I am not sure where it's coming from:

image

Do you know where?

PrzemyslawKlys commented 1 year ago

I've renamed the main pipeline. I guess it should work

image

rstm-sf commented 1 year ago

Added info about tests and update readme https://github.com/EvotecIT/OfficeIMO/blob/7ca2e2cd1ea5edcec78fc125712581cabb15113d/README.md

PrzemyslawKlys commented 1 year ago

Is this ready? Or require some more work?

rstm-sf commented 10 months ago

Ok. It's done

Sorry for the delay, but I haven’t yet decided how to find the reason why the test breaks. But everything seems to be fine now (at least they passed several tests in a row). If the AdvancedDocumentTests.AdvancedWordCreate test flickers, you will have to skip it again and create a problem. Can tag me)

Also, I did not add all possible options to the tests. I think this is a good start

PrzemyslawKlys commented 10 months ago

Hi,

Couple of questions:

I'm looking for number of line commits and it's 170k. If that has to happen with every change to library that seems like a lot of commits mostly because of .txt.

I wonder if we're able to somehow solve it differently?

Thank you, Przemek

PrzemyslawKlys commented 10 months ago

I guess change to Azure Devops will break this table?

image

As it's no longer separate, so we won;t be able to tell?

rstm-sf commented 10 months ago

Do we need those csproj changes?

Do you mean end of file? The current file the config, think the IDE fixed it itself https://github.com/EvotecIT/OfficeIMO/blob/2cf68efae04b4917ea911923a7e450463b8d4eab/.editorconfig#L5C1-L5C21

I saw you did remove a lot from gitignore? Not needed? Seems a lot got removed?

Sorry, this is personal :) I can return it back. "GitIgnore for the studio" is more suitable for dense legacy...

Can't we reuse those tests we already have and simply add a line that is responsible for generation?

It's possible, but I don't like how the tests are written. They assume that once launched, the application opens to view the result. This no longer looks like a unit test. In addition, there are no options (as far as I remember) that edit existing documents

I'm looking for number of line commits and it's 170k. If that has to happen with every change to library that seems like a lot of commits mostly because of .txt.

I wonder if we're able to somehow solve it differently?

It seems to me that this is true. Thus, we see all the changes that may affect with PR. The big change will be for new files. Well, now many tests have been added at once

For example, look at this commit https://github.com/EvotecIT/OfficeIMO/pull/86/commits/ca91747997b13b85f0958dcb195a43697013de2f

It shows that new styles were added last year, as well as endnotes and footnotes. Also, there are changes to previously generated properties. I think this is a very clear representation of how the file will change after PR

PrzemyslawKlys commented 10 months ago

Can't we reuse those tests we already have and simply add a line that is responsible for generation?

It's possible, but I don't like how the tests are written. They assume that once launched, the application opens to view the result. This no longer looks like a unit test. In addition, there are no options (as far as I remember) that edit existing documents

Huh? I think we only have that option in Examples, not Tests? And it's always set to False? Not sure I understand?

rstm-sf commented 10 months ago

Huh? I think we only have that option in Examples, not Tests? And it's always set to False? Not sure I understand?

Oops, my fail.

But still, I don’t like that different approaches are mixed. If you want them to be in the same file/project, then I will delete them and add them to the existing ones

PrzemyslawKlys commented 10 months ago

It's fine, just trying to understand, that's all.

PrzemyslawKlys commented 10 months ago

I was just thinking it would mean for every new test, new file would be created as well, and that would lead to larger coverage, but maybe that's a bit too much and it's better to focus on directly those tests.

rstm-sf commented 10 months ago

As it's no longer separate, so we won;t be able to tell?

Sorry, I didn't use azure devops as an administrator. Moreover, I did not generate badges for it. I think it’s worth returning back then (this table is not interesting for me :))

rstm-sf commented 4 months ago

Hello @PrzemyslawKlys

Are we going to merge this?)

Here we can see how the document changed during hold time (the tests did not change) https://github.com/EvotecIT/OfficeIMO/pull/86/commits/d4135d78e53c05098f83eef1374cad46642b6ff7

PrzemyslawKlys commented 4 months ago

Yes, we need to commit to this. I've been putting this away a bit, procrastinating because I know that once I commit this, I will have one more step to take care of with each and every PR ;)