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

Feature #289 sonarqube_test_coverage #293

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/compare_db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ jobs:
shell: bash
run: |
cd /home/runner/work/METdataio/METdataio/baseold/METdbLoad/ush
python met_db_load.py /home/runner/work/METdataio/METdataio/headnew/METdbLoad/tests/load_met_gha_prod.xml
python met_db_load.py /home/runner/work/METdataio/METdataio/headnew/METdbLoad/test/load_met_gha_prod.xml
mysql -e 'SHOW TABLE STATUS WHERE `rows` > 0;' -uroot -proot mv_ci_prod
- name: run METdbload new
shell: bash
run: |
cd /home/runner/work/METdataio/METdataio/headnew/METdbLoad/ush
python met_db_load.py /home/runner/work/METdataio/METdataio/headnew/METdbLoad/tests/load_met_gha_new.xml
python met_db_load.py /home/runner/work/METdataio/METdataio/headnew/METdbLoad/test/load_met_gha_new.xml
mysql -e 'SHOW TABLE STATUS WHERE `rows` > 0;' -uroot -proot mv_ci_new
- name: run test_tables to compare tables in 2 databases
shell: bash
run: python /home/runner/work/METdataio/METdataio/headnew/METdbLoad/tests/test_tables.py
run: python /home/runner/work/METdataio/METdataio/headnew/METdbLoad/test/test_tables.py
2 changes: 1 addition & 1 deletion METdbLoad/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
description='Rewrite of Java MVLoad for METviewer and METexpress database load',
author='Venita Hagerty',
author_email='venita.hagerty@noaa.gov',
packages=find_packages(exclude=['docs', 'tests']),
packages=find_packages(exclude=['docs', 'test']),
long_description=open('README.md').read(), install_requires=['pandas', 'numpy', 'pymysql']
)
2 changes: 1 addition & 1 deletion METdbLoad/tests/README.md → METdbLoad/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Testing for METdbLoad
=====================

There is a program called test_tables.py in the METdbLoad/tests folder in the METdataio repository. It will compare one MySQL subdatabase to another, comparing the row counts and field values. It will compare specified header tables and line type tables.
There is a program called test_tables.py in the METdbLoad/test folder in the METdataio repository. It will compare one MySQL subdatabase to another, comparing the row counts and field values. It will compare specified header tables and line type tables.

Generally, if two different programs (or two versions of the same program) are used to load data (such as MVLoad and METdbLoad), then row counts and the data in rows should be the same. Because of floating point errors, a Python 3.6 and later function (math.isclose) is used to compare floating point numbers such as 1.2 and 1.19999999.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# *** Connect to a "production/old" database
DB2 = 'mv_ci_prod'

cnf_file = "/home/runner/work/METdataio/METdataio/headnew/METdbLoad/tests/gha.cnf"
cnf_file = "/home/runner/work/METdataio/METdataio/headnew/METdbLoad/test/gha.cnf"

conn2 = pymysql.connect(read_default_file=cnf_file, db=DB2)
cur2 = conn2.cursor()
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions internal/scripts/sonarqube/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sonar.projectName=SONAR_PROJECT_NAME
sonar.projectVersion=SONAR_PROJECT_VERSION
sonar.branch.name=SONAR_BRANCH_NAME
sonar.sources=METdbLoad,METreadnc,METreformat
sonar.coverage.exclusions=**/test/*
sonar.sourceEncoding=UTF-8

# SonarQube server
Expand Down
Loading