Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsmaller #9

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c47d809
ddddZOOKEEPER-4037: Closing autoCloseable resource with try-with-reso…
lanicc Jan 26, 2021
84692b7
ZOOKEEPER-3730: fix a typo about watchManagerName in the zookeeperAdm…
Jan 28, 2021
2e1d6a2
ZOOKEEPER-3849: improve the all logs with a necessary time unit at th…
ZWShuai91 Jan 30, 2021
fe06eb6
ZOOKEEPER-4001: Make AuditHelper.addAuditLog(...) more readable
zengchao1212 Feb 2, 2021
99d1351
ZOOKEEPER-4050: Zookeeper Inspector reports "List of default node vie…
brentwritescode Feb 4, 2021
19f07cd
ZOOKEEPER-4007: A typo in the ZKUtil#validateFileInput method
LuoManGit Feb 8, 2021
a7fd801
Revert "ZOOKEEPER-4007: A typo in the ZKUtil#validateFileInput method"
anmolnar Feb 9, 2021
b62bd97
ZOOKEEPER-4207: Remove extra checkout from Jenkinsfile
anmolnar Feb 9, 2021
f73c387
ZOOKEEPER-3987: Reduce fork count for tests to 1
ctubbsii Feb 17, 2021
0a25f4b
ZOOKEEPER-4209: Update Netty to 4.1.59.Final
frederiko Feb 17, 2021
f24a353
ZOOKEEPER-4200: Widen latency window in WatcherCleanerTest
ztzg Feb 17, 2021
e113636
ZOOKEEPER-4201: C client: Disable SASL deprecation warnings on macOS
ztzg Feb 17, 2021
c677995
ZOOKEEPER-4199: Avoid thread leak in QuorumRequestPipelineTest
ztzg Feb 18, 2021
219e75b
ZOOKEEPER-4221: Improve the error message when message goes above jut…
Feb 26, 2021
362b799
ZOOKEEPER-4219: Quota checks break setData in multi transactions
ztzg Mar 1, 2021
5def71d
ZOOKEEPER-3922: The introduction of the oracle, a failure detector.
Mar 2, 2021
07a42d7
ZOOKEEPER-3877: JMX Bean RemotePeerBean should enclose IPV6 host in s…
arshadmohammad Mar 2, 2021
fa562fa
ZOOKEEPER-3781: Create snapshots on followers when snapshot.trust.emp…
Mar 6, 2021
2c53fcb
ZOOKEEPER-4220: Potential redundant connection attempts during leader…
symat Mar 6, 2021
9c6773b
ZOOKEEPER-2693: Correct the documentation about response to "ruok" 4lw
nemobis Mar 6, 2021
1a77331
ZOOKEEPER-4217: add new arg 'func' to handle_socket_error_msg()
smikes Mar 7, 2021
2897e34
ZOOKEEPER-4232: InvalidSnapshotTest corrupts its own test data
ztzg Mar 9, 2021
fcc4547
ZOOKEEPER-4210: Preserve return code from nonblocking send
smikes Mar 9, 2021
037158f
ZOOKEEPER-4233: dependency-check:check failing - Jetty 9.4.35.v202011…
ztzg Mar 10, 2021
d226752
ZOOKEEPER-4227: X509AuthFailureTest is failing consistently
arshadmohammad Mar 10, 2021
74633b6
ZOOKEEPER-4230: Use dynamic temp folder instead of static temp folder…
MuktiKrishnan Mar 11, 2021
a77ef0d
ZOOKEEPER-1871: Add an option to zkCli to wait for connection before …
MuktiKrishnan Mar 11, 2021
16d71a4
ZOOKEEPER-4205: Change X509AuthFailureTest to use dynamically assigne…
Mar 17, 2021
258ade1
Modify build files for coverage and sonar analysis
Mar 22, 2021
c6c4574
Modify build files for coverage and sonar analysis...
Mar 22, 2021
a753b2a
D
RokLenarcic Nov 28, 2024
08d86b0
D
RokLenarcic Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .github/workflows/ci.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Run Tests With Clover
on:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Configure credentials
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
# Run build steps
- run: mvn clean clover:setup
- run: mvn test
- run: mvn clover:aggregate clover:clover
if: always()
- run: aws s3 cp ./target/site/clover/clover.xml s3://codescene-on-prem/code-coverage-data/apache/zookeeper/clover.xml
85 changes: 0 additions & 85 deletions .github/workflows/manual.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Sonar Analysis
on:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Run build steps
- run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -DskipTests -e
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pipeline {
stages {
stage('BuildAndTest') {
steps {
git 'https://github.com/apache/zookeeper'
sh "git clean -fxd"
sh "mvn verify spotbugs:check checkstyle:check -Pfull-build -Dsurefire-forkcount=4"
}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ We always welcome new contributors to the project! See [How to Contribute](https
[mcLink]: https://zookeeper.apache.org/releases
[trBadge]: https://travis-ci.org/apache/zookeeper.svg?branch=master
[trLink]: https://travis-ci.org/apache/zookeeper
A
A
9 changes: 6 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@
</profiles>

<properties>
<!-- sonar properties -->
<sonar.projectKey>zookeeper</sonar.projectKey>
<sonar.organization>knorrest</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<!-- maven properties -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -467,8 +471,8 @@
<mockito.version>3.6.28</mockito.version>
<hamcrest.version>2.2</hamcrest.version>
<commons-cli.version>1.4</commons-cli.version>
<netty.version>4.1.50.Final</netty.version>
<jetty.version>9.4.35.v20201120</jetty.version>
<netty.version>4.1.59.Final</netty.version>
<jetty.version>9.4.38.v20210224</jetty.version>
<jackson.version>2.10.5.1</jackson.version>
<jline.version>2.14.6</jline.version>
<snappy.version>1.1.7.7</snappy.version>
Expand Down Expand Up @@ -683,7 +687,6 @@
<configuration>
<showWarnings>true</showWarnings>
<compilerArgs>
<compilerArg>-Werror</compilerArg>
<compilerArg>-Xlint:deprecation</compilerArg>
<compilerArg>-Xlint:unchecked</compilerArg>
<compilerArg>-Xlint:-options</compilerArg>
Expand Down
16 changes: 16 additions & 0 deletions zookeeper-client/zookeeper-client-c/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,17 @@ int main(int argc, char **argv) {
zoo_deterministic_conn_order(1); // enable deterministic order

#ifdef HAVE_CYRUS_SASL_H
/*
* We need to disable the deprecation warnings as Apple has
* decided to deprecate all of CyrusSASL's functions with OS 10.11
* (see MESOS-3030, ZOOKEEPER-4201). We are using GCC pragmas also
* for covering clang.
*/
#ifdef __APPLE__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

Comment on lines +951 to +961

Choose a reason for hiding this comment

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

❌ Getting worse: Complex Method
main already has high cyclomatic complexity, and now it increases in Lines of Code from 327 to 334

Why does this problem occur?

This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.

if (mechlist) {
zoo_sasl_params_t sasl_params = { 0 };
int sr;
Expand Down Expand Up @@ -977,6 +988,11 @@ int main(int argc, char **argv) {
return errno;
}
}

#ifdef __APPLE__
#pragma GCC diagnostic pop
#endif

#endif /* HAVE_CYRUS_SASL_H */

if (!zh) {
Expand Down
15 changes: 15 additions & 0 deletions zookeeper-client/zookeeper-client-c/src/zk_sasl.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
#include "zk_adaptor.h"
#include "zookeeper_log.h"

/*
* We need to disable the deprecation warnings as Apple has decided to
* deprecate all of CyrusSASL's functions with OS 10.11 (see
* MESOS-3030, ZOOKEEPER-4201). We are using GCC pragmas also for
* covering clang.
*/
#ifdef __APPLE__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

/*
* Store a duplicate of src, or NULL, into *target. Returns
* ZSYSTEMERROR if no memory could be allocated, ZOK otherwise.
Expand Down Expand Up @@ -539,3 +550,7 @@ sasl_callback_t *zoo_sasl_make_basic_callbacks(const char *user,
return xcallbacks;
}
}

#ifdef __APPLE__
#pragma GCC diagnostic pop
#endif
Loading