Conversation
823b2ff to
020617e
Compare
bin/utils/db_test.py
Outdated
There was a problem hiding this comment.
If --plugin-dir is specified but it's different from the current directory, then, the script will fallback to running the test on Indico core. This seems a bug to me. Here's the pseudocode:
if not plugin_dir:
# Run the tests on Indico core
else:
if plugin_dir.samefile(os.getcwd()):
# Run the tests on plugin
else:
with _chdir(plugin_dir):
# Run the tests on pluginThere was a problem hiding this comment.
If --plugin-dir is specified but it's different from the current directory, then, the script will fallback to running the test on Indico core
No, it should fall back to running on indico if the plugin_dir is same as current directory. If the plugin directory is not the current indico directory then it should run on the plugin.
There was a problem hiding this comment.
The logic that I'm applying now is that --plugin-dir instructs the script to be run for a plugin.
The problem that I was facing is the following.
- My current working directory is the plugin directory.
- I pass
--plugin-dir . - Because
plugin_diris the same as the working directory, the script runs in Indico core mode, failing.
There was a problem hiding this comment.
Now raising an exception if the indico directory is passed as the plugin_dir
58b4fdd to
31ab022
Compare
bd00a95 to
ff96572
Compare
| _run(['psql', DB_NAME, '-c', 'CREATE EXTENSION pg_trgm;']) | ||
| _run(['psql', DBDIFF_NAME, '-c', 'CREATE EXTENSION unaccent;']) | ||
| _run(['psql', DBDIFF_NAME, '-c', 'CREATE EXTENSION pg_trgm;']) | ||
| _run(['indico', 'db', 'prepare']) |
There was a problem hiding this comment.
Would there be a quicker way to prepare DB? Running indico command is very slow.
There was a problem hiding this comment.
no, as it needs to import all the models etc which is what makes it slow
| # TODO: Is this the best way to get the plugin name? | ||
| packages = [x.parent.name for x in plugin_dir.glob('*/__init__.py')] |
There was a problem hiding this comment.
Is this the best way to get the plugin name?
5c1ca47 to
5fb7456
Compare
Co-authored-by: Alejandro Avilés <[email protected]>
Commands:
For indico:
python bin/utils/db_test.py -v --nb-scripts 10For a plugin:
python bin/utils/db_test.py -v --nb-scripts 10 --plugin-dir <plugin-dir>The script will be added to the ci
The script checks the following:
Example Issues