Comments (10)
quattor/CAF#202 should fix this. we should retest once that PR is tested and merged.
from maven-tools.
quattor/CAF#202 may fix it but I checked the Test/Quattor.pm
test and I don't understand why it fails as LC_Check
is supposed to be mocked... Something strange to me: Test/Quattor.pm
has an exported function make_directory
but there is also a make_directory
in simple_caf used by tests... Logic not clear to me...
from maven-tools.
I manage to find the culprit... This is the mocked CAF::FileWriter::close()
. It calls the original CAF::FileWriter::close()
which seems a little bit odd as there is no point to mock it if we call it (well it is not completely true as the mocked version updates the %desired_file_contents
hash)... Removing this call, I have been able to check that maven tools build-scripts can be built successfully and that it does fix the problem in aii-pxelinux
. But it remove of the diff
handling and the reporting about the differences: I don't know if this may be a problem in other contexts. Another approach could be not to execute the LC::Check::file
call if noaction
is set (which is the case as it is set by the mocked constructor).
@stdweird any opinion?
from maven-tools.
I had a look as the second solution (set noaction
option before calling the original close()
and not calling LC::Check::file
in this case). It looks to me the right way to do it but in this case we also need to force noAction
in the mocked context which is not currently the case conversely to what I said... Comments welcome!
from maven-tools.
how can i repoduce this issue? and have you tried the new filewriter? i have never had an issue with the original code; but we probably run NoAction=1 everywhere where we shouldn't.
best way to deal with this is proabably shipping a dummy LC or Atomic module with maven-tools, similar to the CAF uses in its unittests and also the components.
from maven-tools.
@stdweird I found this issue after your remark that we were abusing NoAction=1
in the unit tests and that it was not necessary now that CAF was mocked in maven tools... You can easily reproduce the problem by running write_pxelinux_config.t
in UEFI PR after removing NoAction=1
.
After thinking more at this problem, I think that what is wrong is to execute the original method in the mocked one. I've the feeling that the right approach is what I did with links: have a mocked version that is implementing the feature of the original one (like reporting diffs for example).
An alternative could be to set noaction
option (at least by default) before calling the original close()
but I don't know if if may break some tests in other Quattor components...
from maven-tools.
ok, i see.
yes, Noaction is not used properly in most unittests and this issue would indeed prevent people from doing so.
however, i'm not convinced we should reinplement the CAF code here, shipping a dummy LC or Atomic module will do the same trick with a lot less work.
but there are also cases where the mocking cannot be done, eg during the test profile CCM part. that needs fully functional FileWriter. it's also not a big issue as long as all compilation is triggered via the import hack.
from maven-tools.
@stdweird your CCM use case is a reason I was proposing to set noaction
option of the FW instance to 1 by default in the constructor or in close()
. This would allow to define CAF::Object:NoAction=0 when this is needed (and in this case noaction
option will be set to 0 too).
from maven-tools.
I just pushed a commit implement the noaction
idea to make it more clear! I tested that it does fix the aii-pxelinux
issue when NoAction=1
is removed from unit tests and that CAF unit tests work properly too. I could not verify CCM as I fail to run successfully the tests on the master without the modified build tools... @stdweird as you have a cleaner dev environment than me, may be you could validate the impact and if it is enough to define $CAF::Object::NoAction=0
to fix problems if any?
from maven-tools.
I believe this was closed by #160.
from maven-tools.
Related Issues (20)
- build-scripts requires a Perl-Critic version not available on SL6 HOT 8
- mavenprove fails to test CAF
- tracing guideline
- tests try to generate tabcompletion
- /Test/Quattor/Panc.pm: annotation regexp is incorrect HOT 1
- Test::Quattor: mock the new symlink-related methods
- random pan annotation failures HOT 5
- use diagnostics HOT 3
- Update cfg-module used to create a new component skeleton
- _make_link: allow keeps_state HOT 1
- Build fails while trying to generate docs using Java 1.8 HOT 8
- Reinstate `warn_is_ok = 0` / remove `set_caf_file_close_diff`
- Allow testing of immutable files
- Test::Quattor: review status usage
- make a maven template for scripts
- Mock NCM::Component::prefix() correctly HOT 1
- investigate missed missing import
- javadoc doclint issues HOT 1
- junit / xunit issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maven-tools.