Bug 1067059
Summary: | Support for unit tests in GlusterFS | ||
---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Luis Pabón <lpabon> |
Component: | build | Assignee: | Luis Pabón <lpabon> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | mainline | CC: | bugs, gluster-bugs, lpabon, madam, ndevos, sasundar |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | glusterfs-3.6.0beta1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-11-11 08:28:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Luis Pabón
2014-02-19 15:15:33 UTC
Public Trello card for work: https://trello.com/b/dTlPxmpV/glusterfs-unit-test-infrastructure-project REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#1) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#2) for review on master by Vijay Bellur (vbellur) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#3) for review on master by Vijay Bellur (vbellur) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#4) for review on master by Vijay Bellur (vbellur) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#5) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#6) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#7) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#8) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#9) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#10) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#11) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#12) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#13) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#14) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#15) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#16) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#17) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#18) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7145 (build: GlusterFS Unit Test Framework) posted (#19) for review on master by Luis Pabon (lpabon) COMMIT: http://review.gluster.org/7145 committed in master by Vijay Bellur (vbellur) ------ commit c817c214033481fe59f9f44c325a9092dc337d07 Author: Luis Pabon <lpabon> Date: Thu Feb 20 13:50:19 2014 -0500 build: GlusterFS Unit Test Framework This patch will allow for developers to create unit tests for their code. Documentation has been added to the patch and is available here: doc/hacker-guide/en-US/markdown/unittest.md Also, unit tests are run when RPM is created. BUG: 1067059 Change-Id: I95cf8bb0354d4ca4ed4476a0f2385436a17d2369 Signed-off-by: Vijay Bellur <vbellur> Signed-off-by: Luis Pabon <lpabon> Reviewed-on: http://review.gluster.org/7145 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Rajesh Joseph <rjoseph> Reviewed-by: Justin Clift <justin> Tested-by: Justin Clift <justin> Nightly builds for glusterfs/master are failing for a while, and this change seems to be the cause :-/ Currently the glusterfs.tar.gz that gets generated with 'make dist' bundles the cmockery2 code. This should be a normal build-dependency, just like any other library. Checking out a 2nd git repository while generating a 'make dist' tarball is very fragile. This can now not be an offline procedure anymore. It also assumes that the build-system has git available (new build dependency). It is currently not possible to update/patch some of Makefile.am or configure.ac and re-run ./autogen.sh when git is not available, or when github.com can not be reached. Also most downstream distributions frown upon code bundling. For example, Fedora advises to 'rm -rf' any bundled libraries/files that are included in the 'make dist' tarballs before building code. When looking for cmockery(2) packages in Fedora, I found libcmocka (http://cmocka.org/). This seems to be the replacement for cmockery, and upstream is more active. This makes me wonder if we should proceed with the cmockery2 dependency, or move to the more recent libcmocka? Where can I get information on how to create the nightly build on my development system so that I can investigate the issue. On Cmocka: I have no issues about cmocka, but I just wanted a very simple way for developers to create unit tests. Cmocka is Cmake based and cannot be part of the tree. Developers will have to install it (which is not a big deal, but my goal was to be as non-intrusive as possible). My enhancements to cmockery to support PBC and Junit xml can be ported to cmocka if we ever want to go that way. FYI, cmockery is pretty stable, must of the work in cmocka and cmockery2 is around the build system. REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#19) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#20) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#21) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#22) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#23) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#24) for review on master by Luis Pabon (lpabon) REVIEW: http://review.gluster.org/7538 (build: Support for unit tests using Cmockery2) posted (#25) for review on master by Luis Pabon (lpabon) COMMIT: http://review.gluster.org/7538 committed in master by Vijay Bellur (vbellur) ------ commit 13f644f78336c79850b332c35ad439fda8dac4fa Author: Luis Pabon <lpabon> Date: Wed Apr 23 16:18:57 2014 -0400 build: Support for unit tests using Cmockery2 This patch will allow for developers to create unit tests for their code. Documentation has been added to the patch and is available here: doc/hacker-guide/en-US/markdown/unittest.md Also, unit tests are run when RPM is created. This patch is a replacement for http://review.gluster.org/#/c/7281 which removed unit test infrastucture from the repo due to multiple conflicts. Cmockery2 is now available in Fedora and EPEL, and soon to be available in Debian and Ubuntu. For all other operating systems, please install from the source: https://github.com/lpabon/cmockery2 BUG: 1067059 Change-Id: I1b36cb1f56fd10916f9bf535e8ad080a3358289f Signed-off-by: Luis Pabón <lpabon> Reviewed-on: http://review.gluster.org/7538 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Niels de Vos <ndevos> Reviewed-by: Vijay Bellur <vbellur> A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED. Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution. [1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html [2] http://supercolony.gluster.org/pipermail/gluster-users/ This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.6.1, please reopen this bug report. glusterfs-3.6.1 has been announced [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution. [1] http://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html [2] http://supercolony.gluster.org/mailman/listinfo/gluster-users REVIEW: http://review.gluster.org/9568 (build: better support for cmockery2 unit tests) posted (#1) for review on master by Kaleb KEITHLEY (kkeithle) REVIEW: http://review.gluster.org/9568 (build: better support for cmockery2 unit tests) posted (#2) for review on master by Kaleb KEITHLEY (kkeithle) REVIEW: http://review.gluster.org/9568 (build: better support for cmockery2 unit tests) posted (#3) for review on master by Kaleb KEITHLEY (kkeithle) REVIEW: http://review.gluster.org/9738 (build: better support for cmockery2 unit tests) posted (#1) for review on master by Kaleb KEITHLEY (kkeithle) REVIEW: http://review.gluster.org/9738 (testing: Switch to cmocka the successor of cmockery2) posted (#2) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9801 (build: require cmocka >= 1.0.1) posted (#1) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9802 (build: require cmocka by default for unit testing) posted (#1) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9738 (testing: Switch to cmocka the successor of cmockery2) posted (#3) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9738 (testing: Switch to cmocka the successor of cmockery2) posted (#4) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9801 (build: require cmocka >= 1.0.1) posted (#2) for review on master by Niels de Vos (ndevos) REVIEW: http://review.gluster.org/9802 (build: require cmocka by default for unit testing) posted (#2) for review on master by Niels de Vos (ndevos) COMMIT: http://review.gluster.org/9738 committed in master by Kaleb KEITHLEY (kkeithle) ------ commit bc2e58a436002e1627a225663bc7b11dddc1172f Author: Niels de Vos <ndevos> Date: Wed Feb 18 14:47:01 2015 +0100 testing: Switch to cmocka the successor of cmockery2 This uses https://cmocka.org/ as the unit testing framework. With this change, unit testing is made optional as well. We assume there is no cmocka available while building. cmocka will be enabled by default later on. For now, to build with cmocka run: $ ./configure --enable-cmocka This change is based on the work of Andreas (replacing cmockery2 with cmocka) and Kaleb (make cmockery2 an optional build dependency). The only modifications I made, are additional #defines in unittest.h for making sure the unit tests function as expected. Change-Id: Iea4cbcdaf09996b49ffcf3680c76731459cb197e BUG: 1067059 Merged-change: http://review.gluster.org/9762/ Signed-off-by: Andreas Schneider <asn> Signed-off-by: Kaleb S. KEITHLEY <kkeithle> Signed-off-by: Niels de Vos <ndevos> Change-Id: Ia2e955481c102d5dce17695a9205395a6030e985 Reviewed-on: http://review.gluster.org/9738 Tested-by: Gluster Build System <jenkins.com> COMMIT: http://review.gluster.org/9801 committed in master by Kaleb KEITHLEY (kkeithle) ------ commit 9c37b68bc15c503a0ad5cc2fb04be7b917496d90 Author: Niels de Vos <ndevos> Date: Tue Mar 3 00:27:34 2015 +0100 build: require cmocka >= 1.0.1 Our mem-pool unit test does a funky realloc(ptr, 0) as an alternative to free(ptr). cmocka 1.0.0 has a bug where this is not handled correctly and thinks to detect a memory leak. The next cmocka release will have this bug fixed, making our unit tests require cmocka >= 1.0.1. URL: https://cmocka.org/archive/cmocka/2015-02/0000059.html Change-Id: I3d7f9b4cf7ace3f958158425ecbcc8f176579122 BUG: 1067059 Signed-off-by: Niels de Vos <ndevos> Reviewed-on: http://review.gluster.org/9801 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Andreas Schneider <asn> Tested-by: Andreas Schneider <asn> Reviewed-by: Kaleb KEITHLEY <kkeithle> REVIEW: http://review.gluster.org/9802 (build: require cmocka by default for unit testing) posted (#3) for review on master by Niels de Vos (ndevos) |