Skip to content

Remove gtest file from cpp library - #9816

Merged
merlimat merged 3 commits into
apache:masterfrom
zymap:fix-license-issue
Mar 5, 2021
Merged

Remove gtest file from cpp library#9816
merlimat merged 3 commits into
apache:masterfrom
zymap:fix-license-issue

Conversation

@zymap

@zymap zymap commented Mar 5, 2021

Copy link
Copy Markdown
Member

Motivation

PR #9072 introduces the gtest file and a new license header.
Actually, we can avoid introducing the new license header by
adding the macro in our code.

---

**Motivation**

PR apache#9072 introduces the gtest file but does not exclude for apache-rat
check. So that causes the apache-rat check to fail.
@merlimat

merlimat commented Mar 5, 2021

Copy link
Copy Markdown
Contributor

A couple of notes on #9072:

  1. That header file is just a tiny macro, we shouldn't need to import a file from gtest for that
  2. The macro is about tests and must not be exposed in public API

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

One curiosity:
Aren't we running apache-rat at every PR validation?

@zymap

zymap commented Mar 5, 2021

Copy link
Copy Markdown
Member Author

We are not running the apache-rat so I added it at PR #9815

@zymap

zymap commented Mar 5, 2021

Copy link
Copy Markdown
Member Author

@merlimat @BewareMyPower Could you please take a look at this? I remove the gtest file and move the macro into the lib dir. Thanks

@zymap
zymap force-pushed the fix-license-issue branch from 7a789e1 to af40266 Compare March 5, 2021 09:19
Comment thread pulsar-client-cpp/lib/TestUtil.h Outdated
@BewareMyPower

Copy link
Copy Markdown
Contributor

Since the original gtest_prod.h has been removed, the pom.xml should remove following code as well.

 <exclude>pulsar-client-cpp/include/gtest/gtest_prod.h</exclude>

@BewareMyPower

BewareMyPower commented Mar 5, 2021

Copy link
Copy Markdown
Contributor

There're three places that included the gtest_prod.h before:

lib/UnAckedMessageTrackerEnabled.h:21:#include "gtest/gtest_prod.h"
lib/MultiTopicsConsumerImpl.h:21:#include "gtest/gtest_prod.h"
lib/PartitionedConsumerImpl.h:21:#include "gtest/gtest_prod.h"

You should replace it with #include "TestUtil.h"

@zymap

zymap commented Mar 5, 2021

Copy link
Copy Markdown
Member Author

@BewareMyPower I address your comments. Please take a look. thank you

@BewareMyPower BewareMyPower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
can you please change the PR title and description.
We should cite that we are working on the CPP client tests.

@zymap zymap changed the title Fix the apache-rat check Remove gtest file from cpp library Mar 5, 2021
@merlimat merlimat added this to the 2.8.0 milestone Mar 5, 2021
@merlimat
merlimat merged commit 0d5f070 into apache:master Mar 5, 2021
zymap added a commit that referenced this pull request Mar 6, 2021
* Fix the apache-rat check
---

**Motivation**

PR #9072 introduces the gtest file but does not exclude for apache-rat
check. So that causes the apache-rat check to fail.

* Move the test to the another file

* Address comments

(cherry picked from commit 0d5f070)
@zymap zymap added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Mar 6, 2021
mlyahmed pushed a commit to mlyahmed/pulsar that referenced this pull request Mar 7, 2021
* Fix the apache-rat check
---

**Motivation**

PR apache#9072 introduces the gtest file but does not exclude for apache-rat
check. So that causes the apache-rat check to fail.

* Move the test to the another file

* Address comments
zymap added a commit to streamnative/pulsar-archived that referenced this pull request Mar 8, 2021
* Fix the apache-rat check
---

**Motivation**

PR apache#9072 introduces the gtest file but does not exclude for apache-rat
check. So that causes the apache-rat check to fail.

* Move the test to the another file

* Address comments

(cherry picked from commit 0d5f070)
(cherry picked from commit c568834)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants