-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cover can_bundle.py in integration tests (#3196) #3237
Cover can_bundle.py in integration tests (#3196) #3237
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3237 +/- ##
===========================================
+ Coverage 82.55% 82.58% +0.02%
===========================================
Files 123 123
Lines 14246 14254 +8
===========================================
+ Hits 11761 11771 +10
+ Misses 2485 2483 -2
Continue to review full report at Codecov.
|
31d1b85
to
ff05567
Compare
test/integration_test.py
Outdated
'--output-dir', output_dir | ||
] | ||
args = [shlex.quote(arg) for arg in args] | ||
result = subprocess.run(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just import and call main()
directly? It would make debugging easier in the case of a failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we weren't supposed to import from scripts/
from other locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you mention it, I remember hearing that too... though I wonder if testing a script like this is worthwhile exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have to make it an exception because mock.patch
can't cross process boundaries, and we need to patch the configured catalogs in order to test the canned repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Worth noting that the Pycharm debugger does seem to be capable of crossing process boundaries. When I put a breakpoint in the script and invoked it via subprocess.run
, it stopped at the breakpoint).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Worth noting that the Pycharm debugger does seem to be capable of crossing process boundaries. When I put a breakpoint in the script and invoked it via subprocess.run, it stopped at the breakpoint).
Good to know, thanks for testing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ff05567
to
06b870f
Compare
test/integration_test.py
Outdated
plugin = RepositoryPlugin.load(catalog).create(catalog) | ||
spec = first(plugin.sources) | ||
source = plugin.resolve_source(str(spec)) | ||
return first(plugin.list_bundles(source, prefix=source.spec.prefix)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't worth troubling about, but the list_bundles query fetches all the bundles with that prefix when you're only trying to get one. Ideally the size could be specified in the query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list_bundles query fetches all the bundles with that prefix
This might be just a confusion of terminology, but RepositoryPlugin.list_bundles
does not fetch any bundles, it only lists the bundle FQIDs. RepositoryPlugin.fetch_bundle
is a separate method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still lists all bundles even though it only needs one. This will definitely cause trouble in dev and prod where no prefix is used on the IT catalogs and 100k+ bundles will be returned. The indexing IT uses a technique to shrink a randomly chosen prefix until 64 bundles match. You should use that or something like that here too. Second, it would be nice to use a randomly selected bundle but the indexing test prefix selection already takes care of that. As always, it should be possible to seed the random generator with minimal code changes in order to be able to reproduce IT failures.
7332d6c
to
835f65c
Compare
87a3a24
to
6d9f439
Compare
6660151
to
591ae73
Compare
6d9f439
to
4c9c7f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve, but I think something is wrong with the history. The first commit shouldn't show up in this PR, but rather in the PR for 3249. Probably you just need to rebase onto that branch again.
6a4091a
to
57405b0
Compare
Should I be assigned? |
caee57c
to
ae262b5
Compare
ddea6a5
to
717e8b6
Compare
717e8b6
to
f9704f2
Compare
3d8cee4
to
9eebd30
Compare
f9704f2
to
b5390c0
Compare
3977d35
to
cfaaacb
Compare
b5390c0
to
c92e549
Compare
c92e549
to
68ac757
Compare
22175e3
to
da4a172
Compare
68ac757
to
b764fed
Compare
b764fed
to
07397b0
Compare
Author
Author (reindex)
r
tag to commit title or this PR does not require reindexingreindex
label to PR or this PR does not require reindexingAuthor (freebies & chains)
chain
label to the blocking PR or this PR is not chained to another PRAuthor (upgrading)
u
tag to commit title or this PR does not require upgradingupgrade
label to PR or this PR does not require upgradingAuthor (requirements, before every review)
make requirements_update
or this PR leaves requirements*.txt, common.mk and Makefile untouchedR
tag to commit title or this PR leaves requirements*.txt untouchedreqs
label to PR or this PR leaves requirements*.txt untouchedAuthor (before every review)
make integration_test
passes in personal deployment or this PR does not touch functionality that could break the ITdevelop
, squashed old fixupsPrimary reviewer (after approval)
no demo
no sandbox
Operator (before pushing merge the commit)
reindex
label andr
commit title tagno demo
no sandbox
sandbox
label or PR is labeledno sandbox
sandbox
or this PR does not require reindexingsandbox
sandbox
or this PR does not require reindexingsandbox
Operator (after pushing the merge commit)
N reviews
labelling is accurateOperator (reindex)
dev
or this PR does not require reindexing or does not targetdev
dev
or this PR does not require reindexing or does not targetdev
prod
or this PR does not require reindexing or does not targetprod
prod
or this PR does not require reindexing or does not targetprod
Operator