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

[Github] Add coverage #526

Merged
merged 158 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 154 commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
1d2b143
add local unit-test coverage
tomerm-iguazio May 16, 2024
e55eae7
ignore env.yml
tomerm-iguazio May 16, 2024
df70526
add coverage-full for integration + unit tests coverage...
tomerm-iguazio May 20, 2024
a9ae4e3
created push-dev.yml
tomerm-iguazio May 21, 2024
ce4c95f
ignore development on regular push
tomerm-iguazio May 21, 2024
bed3f3d
add env to integration tests
tomerm-iguazio May 21, 2024
92d2fa6
edit
tomerm-iguazio May 21, 2024
4747c59
add coverage upload and download...
tomerm-iguazio May 21, 2024
88b3ab7
fix name
tomerm-iguazio May 21, 2024
e6402fc
fix name
tomerm-iguazio May 21, 2024
d86d369
fix needs
tomerm-iguazio May 21, 2024
27fe0e7
fix needs - only unit tests
tomerm-iguazio May 21, 2024
4dfa5e8
fix path
tomerm-iguazio May 21, 2024
7e35691
display sizes
tomerm-iguazio May 21, 2024
c69639f
change upload download
tomerm-iguazio May 21, 2024
31e6ac3
add coverage-combine to workflow.
tomerm-iguazio May 21, 2024
dca6653
add integration to needs.
tomerm-iguazio May 21, 2024
03b6600
delete comments
tomerm-iguazio May 21, 2024
7d8ebc4
change branch
tomerm-iguazio May 21, 2024
b214e1f
disable push.yml
tomerm-iguazio May 21, 2024
85c4bf6
trigger
tomerm-iguazio May 21, 2024
3cf3fa5
delete pyc file in coverage combine
tomerm-iguazio May 22, 2024
4348bfc
ignore pyc in integ
tomerm-iguazio May 22, 2024
4c38214
add problematic file to ignore.
tomerm-iguazio May 22, 2024
de8fc5e
add problematic file to ignore.2
tomerm-iguazio May 22, 2024
b761f6f
add -i to coverage report
tomerm-iguazio May 22, 2024
4fbee79
change integration for testing..
tomerm-iguazio May 22, 2024
00a2c46
add -i
tomerm-iguazio May 22, 2024
1756c27
cd storey in integration
tomerm-iguazio May 22, 2024
876cb53
add source to integration run
tomerm-iguazio May 23, 2024
8ea6f1c
checkout in push-dev
tomerm-iguazio May 23, 2024
d3f8ddb
checkout in push-dev 2
tomerm-iguazio May 23, 2024
3d1db31
change -i where not needed
tomerm-iguazio May 23, 2024
bec90e3
add pwd
tomerm-iguazio May 23, 2024
d493203
change working-directory
tomerm-iguazio May 23, 2024
e42ef59
change working-directory 2
tomerm-iguazio May 23, 2024
cd81d52
change working-directory 3
tomerm-iguazio May 23, 2024
472bfe0
change working-directory 4
tomerm-iguazio May 23, 2024
cd79845
change working-directory 5
tomerm-iguazio May 23, 2024
65cdfa1
add ls
tomerm-iguazio May 23, 2024
1325fdf
add ls __w
tomerm-iguazio May 23, 2024
793458d
fix fail handling
tomerm-iguazio May 23, 2024
ef7b08b
keep files
tomerm-iguazio Jun 3, 2024
6e81c15
delete working dir
tomerm-iguazio Jun 3, 2024
ba7fe3e
change ls
tomerm-iguazio Jun 3, 2024
e1508f7
fix source in make coverage files.
tomerm-iguazio Jun 3, 2024
bc22687
add pwd to unit tests.
tomerm-iguazio Jun 3, 2024
6e6df06
add ls to unit tests.
tomerm-iguazio Jun 3, 2024
62edd4f
add working-directory:
tomerm-iguazio Jun 3, 2024
6e73d59
switch order in combine
tomerm-iguazio Jun 3, 2024
d68da84
add pwd + ls in combine job
tomerm-iguazio Jun 3, 2024
82979f6
switch to cp try
tomerm-iguazio Jun 3, 2024
ecd8811
switch to cd
tomerm-iguazio Jun 3, 2024
d6de9c2
switch to cd 2
tomerm-iguazio Jun 3, 2024
7cd1388
switch to cd 3
tomerm-iguazio Jun 3, 2024
716de1b
switch to cd 4
tomerm-iguazio Jun 3, 2024
67d527d
pwd change
tomerm-iguazio Jun 3, 2024
934b49a
change working directory
tomerm-iguazio Jun 3, 2024
f13c0e7
fix Upload coverage report
tomerm-iguazio Jun 3, 2024
2b8c98f
change ls
tomerm-iguazio Jun 3, 2024
25c500b
change cp
tomerm-iguazio Jun 3, 2024
f92f50c
add ls
tomerm-iguazio Jun 3, 2024
674a97d
add ls 4
tomerm-iguazio Jun 3, 2024
52fe939
switch to mv form cp
tomerm-iguazio Jun 3, 2024
f236a26
add another mkdir
tomerm-iguazio Jun 3, 2024
cc005ea
add another mkdir
tomerm-iguazio Jun 3, 2024
7d6ee17
change to link
tomerm-iguazio Jun 3, 2024
19d661d
remove mkdir
tomerm-iguazio Jun 3, 2024
35420c5
add mkdir
tomerm-iguazio Jun 3, 2024
d8155aa
change upload
tomerm-iguazio Jun 3, 2024
e024858
change to mv again
tomerm-iguazio Jun 4, 2024
b840992
change to checkout
tomerm-iguazio Jun 4, 2024
7b27a49
change to checkout 2
tomerm-iguazio Jun 4, 2024
d587ecf
remove default work-dir
tomerm-iguazio Jun 4, 2024
a899d20
fix lint
tomerm-iguazio Jun 4, 2024
8c09c4f
hard link
tomerm-iguazio Jun 4, 2024
98fbc6e
back to cp
tomerm-iguazio Jun 4, 2024
038c62c
dev-env in new directory
tomerm-iguazio Jun 4, 2024
08b6dc5
change upload report path integ
tomerm-iguazio Jun 4, 2024
efd8a5a
use rc file in coverage combine
tomerm-iguazio Jun 4, 2024
0267c79
fix combine
tomerm-iguazio Jun 4, 2024
4ef1179
add rc_file to integration_tests
tomerm-iguazio Jun 4, 2024
2f43a38
use relative_files
tomerm-iguazio Jun 4, 2024
648f787
remove comments
tomerm-iguazio Jun 4, 2024
7df134d
fix rcfiles usage in combine, unit test and integ
tomerm-iguazio Jun 4, 2024
b2d2bbb
back to full tests...
tomerm-iguazio Jun 4, 2024
44d30a8
remove ls, pwd
tomerm-iguazio Jun 4, 2024
8104e3c
add source to integ
tomerm-iguazio Jun 4, 2024
a4b2a30
remove cd...
tomerm-iguazio Jun 4, 2024
06e536e
back to full tests - no cd in integ
tomerm-iguazio Jun 4, 2024
721d4f9
remove cover-integ continue after test failure
tomerm-iguazio Jun 4, 2024
7bf4b10
remve comment
tomerm-iguazio Jun 4, 2024
7a7a403
add git ignore, remove env.yml for ignore files
tomerm-iguazio Jun 4, 2024
32d8c79
remove comments
tomerm-iguazio Jun 4, 2024
979c3d8
add empty line
tomerm-iguazio Jun 4, 2024
3d11d5e
return push.yml
tomerm-iguazio Jun 4, 2024
6fddc7b
add empty line
tomerm-iguazio Jun 4, 2024
bd162b3
return push-dev.yml to dev branch.
tomerm-iguazio Jun 4, 2024
3ae65c8
update upload and download actions versions
tomerm-iguazio Jun 4, 2024
3c2fdaa
switch back to dev branch
tomerm-iguazio Jun 4, 2024
d06629b
remove ls+pwd
tomerm-iguazio Jun 4, 2024
bc81c1b
added if to make test
tomerm-iguazio Jul 1, 2024
1aba0ed
add if to integration make target
tomerm-iguazio Jul 2, 2024
b6198f7
remove coverage,full-coverage-unit-tests, coverage-integration in mak…
tomerm-iguazio Jul 17, 2024
6f1aca6
fix order
tomerm-iguazio Jul 17, 2024
ab5f2db
fix test coverage.
tomerm-iguazio Jul 17, 2024
cd75bbe
make integ coverage for 1 test for debug
tomerm-iguazio Jul 17, 2024
fbefc16
combining them
tomerm-iguazio Jul 17, 2024
47e43c4
change coverage commands
tomerm-iguazio Jul 21, 2024
5d3b30b
change test + change debug branch
tomerm-iguazio Jul 21, 2024
aa5163c
fix coverage unit test report path
tomerm-iguazio Jul 21, 2024
51f96b9
change echo format in non-condtion places.
tomerm-iguazio Jul 21, 2024
59940d3
remove .gitignore
tomerm-iguazio Jul 21, 2024
8a3ceb8
fix ; usage
tomerm-iguazio Jul 21, 2024
b967c09
rename full-coverage to coverage
tomerm-iguazio Jul 21, 2024
a196faa
try to use github_run_id to avoid dups
tomerm-iguazio Jul 21, 2024
0c2227d
add rename
tomerm-iguazio Jul 21, 2024
1d92707
add retention-days
tomerm-iguazio Jul 21, 2024
d1fe06f
added ls
tomerm-iguazio Jul 21, 2024
7692ff8
added ls
tomerm-iguazio Jul 21, 2024
f87c8ee
added pwd
tomerm-iguazio Jul 21, 2024
403b4e3
path changing
tomerm-iguazio Jul 21, 2024
08d5fa5
add another ls
tomerm-iguazio Jul 22, 2024
6390ec6
remove ls pwd
tomerm-iguazio Jul 22, 2024
47af340
remove regular push.yml-that was on branches that are not dev.
tomerm-iguazio Jul 22, 2024
71f1781
delete empty name step
tomerm-iguazio Jul 22, 2024
2a06fe8
back to full tests.
tomerm-iguazio Jul 22, 2024
83acca5
use coverage_reports for order
tomerm-iguazio Jul 22, 2024
4254b87
Merge branch 'use_coverage_folder' into local-coverage
tomerm-iguazio Jul 22, 2024
83cdd30
combining coverage folder pr
tomerm-iguazio Jul 22, 2024
c02b393
back to branch development
tomerm-iguazio Jul 22, 2024
bedf3e5
change docker ignore
tomerm-iguazio Jul 22, 2024
1e08159
add upload for combined report
tomerm-iguazio Jul 22, 2024
7731f56
back to development
tomerm-iguazio Jul 23, 2024
a8da4cc
change retention-days to 90
tomerm-iguazio Jul 23, 2024
a749a00
rename full-coverage to coverage
tomerm-iguazio Jul 24, 2024
29338a8
remove rm in coverage-combine
tomerm-iguazio Jul 24, 2024
3c7e8c7
split test and test-coverage
tomerm-iguazio Jul 24, 2024
ac24436
change Makefile.
tomerm-iguazio Jul 24, 2024
cb15e92
fix makefile
tomerm-iguazio Jul 24, 2024
a74d73b
some lints
tomerm-iguazio Jul 24, 2024
15f743f
some lints
tomerm-iguazio Jul 24, 2024
6d07308
back to development
tomerm-iguazio Jul 24, 2024
b15645d
lint
tomerm-iguazio Jul 25, 2024
776c3d1
lint + requirements loose
tomerm-iguazio Jul 25, 2024
2e7b1fc
fix messages
tomerm-iguazio Jul 25, 2024
e364e29
fix messages 2
tomerm-iguazio Jul 25, 2024
5d37994
add blank
tomerm-iguazio Jul 25, 2024
51c0061
change in gitignore
tomerm-iguazio Jul 25, 2024
058ac47
added clean-integration
tomerm-iguazio Jul 25, 2024
8b8279a
back to local-coverage to test...
tomerm-iguazio Jul 25, 2024
f488a24
back to development
tomerm-iguazio Jul 25, 2024
e7f6c23
remove dup
tomerm-iguazio Jul 25, 2024
3947e79
merge clean test and clean integration to clean
tomerm-iguazio Jul 29, 2024
bbe6eb2
fixed clean to one line.
tomerm-iguazio Jul 29, 2024
2b67b24
change to tests
tomerm-iguazio Jul 29, 2024
1ee2e5d
change to local-coverage
tomerm-iguazio Jul 29, 2024
d953363
change to dev
tomerm-iguazio Jul 29, 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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
venv
*.coverage
coverage_reports
90 changes: 90 additions & 0 deletions .github/workflows/push-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Dev Changes

on:
push:
branches:
- development

jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Install dependencies
run: make dev-env
- name: Run unit tests
run: make test-coverage
# In order to get unique identifier we use github.run_id with artifact name.
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_unit_tests_report-${{ github.run_id }}
path: coverage_reports/unit_tests.coverage
retention-days: 90

integration:
name: Integration tests
runs-on: [ self-hosted, Linux ]
container:
image: python:3.9.18
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: make dev-env

- name: Run integration tests
env:
V3IO_API: ${{ secrets.V3IO_API }}
V3IO_ACCESS_KEY: ${{ secrets.V3IO_ACCESS_KEY }}
V3IO_FRAMESD: ${{ secrets.V3IO_FRAMESD }}
run: make integration-coverage
# In order to get unique identifier we use github.run_id with artifact name.
- name: Upload coverage report
assaf758 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/upload-artifact@v4
with:
name: coverage_integration_report-${{ github.run_id }}
path: coverage_reports/integration.coverage
retention-days: 90

coverage:
name: Full coverage
runs-on: ubuntu-latest
needs: [test, integration]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Install dependencies
run: make dev-env
# File name is not effected by the artifact name (=identifier only)
- name: Download unit tests coverage report
uses: actions/download-artifact@v4
with:
name: coverage_unit_tests_report-${{ github.run_id }}
# Where to download. file downloaded by name.
path: coverage_reports/
- name: Download integration coverage report
uses: actions/download-artifact@v4
with:
name: coverage_integration_report-${{ github.run_id }}
# Where to download. file downloaded by name.
path: coverage_reports/
- name: Combine coverage
run: make coverage-combine

# In order to be able to download it from the github run:
- name: Upload coverage combined report
uses: actions/upload-artifact@v4
with:
name: coverage_combined_report-${{ github.run_id }}
path: coverage_reports/combined.coverage
retention-days: 90
64 changes: 0 additions & 64 deletions .github/workflows/push.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.gitignore
.idea
venv
*.coverage
coverage_reports
37 changes: 33 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
.NOTPARALLEL:

.PHONY: all
all:
$(error please pick a target)
Expand Down Expand Up @@ -50,22 +52,39 @@ flake8:
@echo "Running flake8 lint..."
@python -m flake8 $(FLAKE8_OPTIONS) $(CHECKED_IN_PYTHON_FILES)

.PHONY: test
test:
.PHONY: clean
clean:
find storey -name '*.pyc' -exec rm {} \;
find tests -name '*.pyc' -exec rm {} \;
find integration -name '*.pyc' -exec rm {} \;
tomerm-iguazio marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: test
test: clean
python -m pytest --ignore=integration -rf -v .

.PHONY: test-coverage
test-coverage: clean
rm -f coverage_reports/unit_tests.coverage
COVERAGE_FILE=coverage_reports/unit_tests.coverage coverage run --rcfile=tests.coveragerc -m pytest --ignore=integration -rf -v .
@echo "Unit test coverage report:"
COVERAGE_FILE=coverage_reports/unit_tests.coverage coverage report --rcfile=tests.coveragerc

.PHONY: bench
bench:
find bench -name '*.pyc' -exec rm {} \;
python -m pytest --benchmark-json bench-results.json -rf -v bench/*.py

.PHONY: integration
integration:
find integration -name '*.pyc' -exec rm {} \;
integration: clean
python -m pytest -rf -v integration

.PHONY: integration-coverage
integration-coverage: clean
rm -f coverage_reports/integration.coverage
COVERAGE_FILE=coverage_reports/integration.coverage coverage run --rcfile=tests.coveragerc -m pytest -rf -v integration
@echo "Integration test coverage report:"
COVERAGE_FILE=coverage_reports/integration.coverage coverage report --rcfile=tests.coveragerc

.PHONY: env
env:
python -m pip install -r requirements.txt
Expand All @@ -90,3 +109,13 @@ set-version:
docs: # Build html docs
rm -f docs/external/*.md
cd docs && make html

.PHONY: coverage-combine
coverage-combine:
rm -f coverage_reports/combined.coverage
COVERAGE_FILE=coverage_reports/combined.coverage coverage combine --keep coverage_reports/integration.coverage coverage_reports/unit_tests.coverage
@echo "Full coverage report:"
COVERAGE_FILE=coverage_reports/combined.coverage coverage report --rcfile=tests.coveragerc -i

.PHONY: coverage
coverage: test-coverage integration-coverage coverage-combine
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ flake8~=5.0
flake8-bugbear~=22.9
isort~=5.7
pytest~=5.4.3
coverage~=7.5
pytest-benchmark~=3.2.3
lupa~=1.13
fakeredis~=1.9
Expand Down
10 changes: 10 additions & 0 deletions tests.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]

source=./storey

omit =
*/tests/*
*/integration/*
test_*

relative_files = True
Loading