Skip to content

Commit

Permalink
MON-21370 fix tests 22.10 (#956)
Browse files Browse the repository at this point in the history
* fix(ci): user proper path to collet packages in get-packages

* force unstable stability

* force unstable stability on delivery

* force get package branchname

* fix(ci): python3-devel needed by pip3

* fix(ci)

* fix(tests): with centos7

* fix(test): EBBPS

* Update tests/broker-engine/services-and-bulk-stmt.robot

Co-authored-by: NITCHEU B <bnitcheu-ext@centreon.com>

* Update tests/broker-engine/services-and-bulk-stmt.robot

Co-authored-by: NITCHEU B <bnitcheu-ext@centreon.com>

* Apply suggestions from code review

Co-authored-by: NITCHEU B <bnitcheu-ext@centreon.com>

* Update tests/broker-engine/services-and-bulk-stmt.robot

Co-authored-by: NITCHEU B <bnitcheu-ext@centreon.com>

* fix(tests): suggestions applied on robot test

* fix test and database_config issue

---------

Co-authored-by: tuntoja <tuntoja@centreon.com>
Co-authored-by: David Boucher <dboucher@centreon.com>
Co-authored-by: omercier <32134301+omercier@users.noreply.github.com>
Co-authored-by: NITCHEU B <bnitcheu-ext@centreon.com>
  • Loading branch information
5 people authored Nov 17, 2023
1 parent d274077 commit d8b7452
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .github/actions/get-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ runs:
echo "[DEBUG] - RELEASE: $RELEASE"
# Obtain latest version.patch-release
PKG_DIR_VERSION=$(curl -Ls "https://yum.centreon.com/standard/22.10/el7/unstable/x86_64/centreon-collect/" | sed -En 's/.*([2-9][0-9]\.[0-9][0-9]\.[[:digit:]]+-[[:digit:]]+\.[[a-z0-9]{7}).*/\1/p' | head -1)
PKG_DIR_VERSION=$(curl -Ls "https://yum.centreon.com/standard/22.10/el7/unstable/x86_64/collect/" | sed -En 's/.*([2-9][0-9]\.[0-9][0-9]\.[[:digit:]]+-[[:digit:]]+\.[[a-z0-9]{7}).*/\1/p' | head -1)
echo "[DEBUG] - PKG_DIR_VERSION: $PKG_DIR_VERSION"
Expand All @@ -82,8 +82,8 @@ runs:
echo "[DEBUG] - https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64"
curl -v -u "${{ inputs.repos_username }}":"${{ inputs.repos_password }}" -X PUT "https://artifactory.apps.centreon.com/artifactory/debian-$VERSION-$REPO/pool/$FILE;deb.distribution=bullseye;deb.component=main;deb.architecture=amd64" -T "./$FILE"
else
echo "[DEBUG] - https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
curl -s -JLO "https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/centreon-collect/centreon-collect-$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
echo "[DEBUG] - https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/collect/$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
curl -s -JLO "https://yum.centreon.com/standard/${{ inputs.version }}/${{ inputs.distrib }}/$REPO/x86_64/collect/centreon-collect-$PKG_DIR_VERSION/$FILE-$PKG_DIR_VERSION.${{ inputs.distrib }}.x86_64.rpm"
fi
done
Expand Down
4 changes: 0 additions & 4 deletions broker/core/inc/com/centreon/broker/database_config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ class database_config {
int connections_count = 1,
unsigned max_commit_delay = 5);
database_config(config::endpoint const& cfg);
database_config(database_config const& other);
~database_config();
database_config& operator=(database_config const& other);
bool operator==(database_config const& other) const;
bool operator!=(const database_config& other) const;

Expand Down Expand Up @@ -80,8 +78,6 @@ class database_config {
void set_check_replication(bool check_replication);

private:
void _internal_copy(database_config const& other);

std::string _type;
std::string _host;
std::string _socket;
Expand Down
40 changes: 0 additions & 40 deletions broker/core/src/database_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,33 +208,11 @@ database_config::database_config(config::endpoint const& cfg) {
_max_commit_delay = 5;
}

/**
* Copy constructor.
*
* @param[in] other Object to copy.
*/
database_config::database_config(database_config const& other) {
_internal_copy(other);
}

/**
* Destructor.
*/
database_config::~database_config() {}

/**
* Assignment operator.
*
* @param[in] other Object to copy.
*
* @return This object.
*/
database_config& database_config::operator=(database_config const& other) {
if (this != &other)
_internal_copy(other);
return *this;
}

/**
* Comparaison operator.
*
Expand Down Expand Up @@ -507,21 +485,3 @@ void database_config::set_connections_count(int count) {
void database_config::set_check_replication(bool check_replication) {
_check_replication = check_replication;
}

/**
* Copy internal data members.
*
* @param[in] other Object to copy.
*/
void database_config::_internal_copy(database_config const& other) {
_type = other._type;
_host = other._host;
_socket = other._socket;
_port = other._port;
_user = other._user;
_password = other._password;
_name = other._name;
_queries_per_transaction = other._queries_per_transaction;
_check_replication = other._check_replication;
_connections_count = other._connections_count;
}
11 changes: 4 additions & 7 deletions ci/scripts/collect-test-robot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,23 @@ echo "Installation..."
/usr/bin/rpm -Uvvh --force --nodeps *.rpm

echo "########################### Install Robot Framework ###########################"
cd /src/tests/
pip3 install -U robotframework robotframework-databaselibrary pymysql python-dateutil psutil

yum groupinstall "Development Tools" -y
yum install python3-devel -y

cd /src/tests/
pip3 install -U robotframework robotframework-databaselibrary pymysql python-dateutil psutil

# Get OS version id
VERSION_ID=$(grep '^VERSION_ID' /etc/os-release | sed -En 's/^VERSION_ID="([[:digit:]])\.[[:digit:]]"/\1/p')

# Force version for el7 only
if [ -f /etc/os-release ]; then
case "$VERSION_ID" in
7)
pip3 install grpcio==1.33.2 grpcio_tools==1.33.2
;;
8)
pip3 install grpcio grpcio_tools
;;
*)
echo "OS Version is neither 7 or 8"
pip3 install grpcio==1.33.2 grpcio_tools==1.33.2
;;
esac
fi
Expand Down
2 changes: 2 additions & 0 deletions tests/bam/inherited_downtime.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Library DateTime
Library OperatingSystem
Library ../resources/Broker.py
Library ../resources/Engine.py
Library ../resources/Common.py

Suite Setup Clean Before Suite
Suite Teardown Clean After Suite
Expand Down Expand Up @@ -460,6 +461,7 @@ BEBAMIGNDTU1
*** Keywords ***
BAM Setup
Stop Processes
Clear Retention
Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort}
${date}= Get Current Date result_format=epoch
log to console date=${date}
Expand Down
Loading

0 comments on commit d8b7452

Please sign in to comment.