Skip to content

Conversation

@craigcomstock
Copy link
Contributor

@craigcomstock craigcomstock commented Sep 7, 2018

See if combining the refactoring and tests to cover refactoring works well with coverage/travis/jenkins. This is the "right" way to do things.

merge together:
#3252
https://github.com/cfengine/enterprise/pull/429

@cf-bottom
Copy link

Thanks for submitting a PR! Maybe @vpodzime can review this?

@codecov
Copy link

codecov bot commented Sep 7, 2018

Codecov Report

Merging #3252 into master will decrease coverage by 0.88%.
The diff coverage is 40.94%.

@@            Coverage Diff             @@
##           master    #3252      +/-   ##
==========================================
- Coverage   64.22%   63.34%   -0.89%     
==========================================
  Files         210      211       +1     
  Lines       46544    46593      +49     
==========================================
- Hits        29893    29514     -379     
- Misses      16651    17079     +428
Impacted Files Coverage Δ
libutils/misc_lib.c 37.5% <ø> (ø) ⬆️
cf-agent/verify_exec.c 73.98% <ø> (+2.31%) ⬆️
cf-serverd/cf-serverd.c 66.66% <0%> (ø)
cf-serverd/cf-serverd-functions.c 6.01% <0%> (+6.01%) ⬆️
libpromises/parser.c 83.52% <0%> (ø) ⬆️
libpromises/cf3parse.y 78.02% <0%> (+0.16%) ⬆️
libutils/alloc.c 88.88% <0%> (ø) ⬆️
libutils/string_lib.c 68.42% <0%> (+1.87%) ⬆️
libpromises/fncall.c 84.17% <0%> (ø) ⬆️
libpromises/unix.c 26.5% <0%> (ø) ⬆️
... and 42 more

Impacted file tree graph


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7eb0be7...64679e9. Read the comment docs.

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from 3f2c639 to fa2dcc9 Compare September 12, 2018 20:04
@craigcomstock
Copy link
Contributor Author

@olehermanse @vpodzime this PR is ready for review. I will squash that last "cleanup" commit. Do you think I should squash the two other commits as well? The first, 55565f9 is the refactor, fa2dcc9 is the tests.

@olehermanse
Copy link
Member

olehermanse commented Sep 13, 2018

I think the best way to look at it is:

Does the commit make more sense if you squash it or less?
Is it a standalone change that makes sense on it's own?
(If you were reviewing it, what git history would you like to read?)

@craigcomstock
Copy link
Contributor Author

Right. I should have two commits: one refactor+test, one whitespace. Will do. :)

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from e23f747 to c3c8292 Compare September 13, 2018 14:28
@craigcomstock
Copy link
Contributor Author

Ok. Commits cleaned up. Thanks @olehermanse :)

@craigcomstock
Copy link
Contributor Author

@olehermanse @vpodzime this is ready for a final code review if you would be so kind. When you are working of course. :) Before rewriting commit history all non-exotics passed on jenkins.

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from c3c8292 to 04c1afe Compare September 20, 2018 12:46
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins build thanks

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

https://ci.cfengine.com/job/pr-pipeline/1186/

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise. The gdb integration is a really cool idea, we should extend it to increase coverage in other places too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird indentation here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think this is a debugging leftover, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to fsync(stdout)?

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from 90e88d6 to 0ed576c Compare September 24, 2018 20:54
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins build please

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

https://ci.cfengine.com/job/pr-pipeline/1200/

@olehermanse
Copy link
Member

This pull request introduces 1 alert when merging 0ed576ccd957ccdf8b1b7da83e0cc5401dd5cd33 into eb7750c - view on LGTM.com

new alerts:

  • 1 for Comparison result is always the same

Comment posted by LGTM.com

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from 0ed576c to 76195c0 Compare September 24, 2018 21:33
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins again

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

https://ci.cfengine.com/job/pr-pipeline/1201/

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from 76195c0 to 0edf865 Compare September 24, 2018 21:40
@craigcomstock
Copy link
Contributor Author

needed a rebase from upstream master. @cf-bottom another jenkins please

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

https://ci.cfengine.com/job/pr-pipeline/1202/

@craigcomstock
Copy link
Contributor Author

@cf-bottom oops, forgot that enterprise PR was included, adjusted there so jenkins build please

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

https://ci.cfengine.com/job/pr-pipeline/1203/

@vpodzime
Copy link
Contributor

Travis seems be consistently failing on this. 😞

@craigcomstock
Copy link
Contributor Author

@olehermanse @vpodzime how would you guys feel about disabling these gdb driven tests on exotics and/or essentially if gdb version is less-than some value that works? Chasing down odd behavior in older versions seems a bit too much work and we already get a lot of benefit from these tests on many platforms.

@craigcomstock
Copy link
Contributor Author

@cf-bottom if you would please, jenkins exotics

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1284/

@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from ae5c47e to a78d1de Compare October 3, 2018 14:02
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins with exotics please

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1290/

@craigcomstock
Copy link
Contributor Author

@cf-bottom try again please: jenkins exotics

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1291/

Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found minor issues with test metadata. I did not do a deep dive, there are many test addtions here! +++

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a meta attribute attached to it referencing the jira issue.
I think it may not skip properly without the issue reference.

 "test_skip_needs_work" string => "redhat_4|debian_4|aix|debian_6|hpux", meta => { "ENT-3765" };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if you add a "description" string then the tests print that out when running.

You can see an example of failing output from tests that contain description and soft_fail here: https://tracker.mender.io/browse/CFE-2910

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nick. I'll take a look tomorrow. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other comment about meta attribute for jira issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta attribute for jira issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta attribute for jira issue

@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins exotics please, now that I have rebased enterprise properly :p

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1292/

@craigcomstock
Copy link
Contributor Author

@cf-bottom another jenkins exotics try please

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1294/

Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you added the meta tag to the meta promises that indicate the tests should be skipped on platforms where they need work.

LGTM.

@craigcomstock craigcomstock dismissed nickanderson’s stale review October 8, 2018 20:30

resolved, not sure why github isn't auto-resolving it.

@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins exotics please

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1319/

@craigcomstock
Copy link
Contributor Author

Well @cf-bottom, could you have mentioned that my dependent repo PR wasn't up-to-date with master? Maybe... oh well. Another try at jenkins + exotics please.

@cf-bottom
Copy link

Alright, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1320/

@craigcomstock craigcomstock dismissed olehermanse’s stale review October 9, 2018 01:58

Jenkins is now green.

@craigcomstock
Copy link
Contributor Author

I could probably improve coverage for cf-promises and cf-serverd but not by much and not for anything truly significant. I think this PR is ready to merge. Thanks for all the feedback/help with this monster.

Refactored use of atexit() to use of a custom cleanup mechanism. On Windows atexit() functions
are called during the unloading process and we have some atexit() functions which rely on
DLLs so this will not work reliably. Refactored so all platforms use RegisterCleanupFunction()
and DoCleanupAndExit() instead of atexit() and exit().
@craigcomstock craigcomstock force-pushed the atexit-refactor-with-tests branch from 5b07fb5 to 64679e9 Compare October 9, 2018 02:02
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins exotics please -craig(ghi)

@cf-bottom
Copy link

Sure, I triggered a build:

Build Status

(with exotics)

https://ci.cfengine.com/job/pr-pipeline/1322/

@craigcomstock craigcomstock merged commit 93428bf into cfengine:master Oct 9, 2018
craigcomstock added a commit to craigcomstock/core that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants