Skip to content

Revert "Add support of macrobenchmark result analysis in fireci (#4285)" #4312

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

Merged
merged 1 commit into from
Nov 11, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/copyright-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.9'
- run: |
pip install -e "ci/fireci"
- run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fireci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.9'
- run: |
pip install -e "ci/fireci[test]"
- run: |
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ firebase-crashlytics-ndk/.externalNativeBuild/
firebase-crashlytics-ndk/.cxx/
smoke-test-logs/
smoke-tests/build-debug-headGit-smoke-test
smoke-tests/firehorn.log
macrobenchmark-output.json
smoke-tests/firehorn.log
26 changes: 11 additions & 15 deletions ci/fireci/fireci/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# limitations under the License.

import click
import contextlib
import functools
import glob
import itertools
import logging
import os
import shutil

from contextlib import contextmanager, nullcontext

_logger = logging.getLogger('fireci')

Expand All @@ -30,7 +30,7 @@ def _ensure_dir(directory):
os.makedirs(directory)


@contextmanager
@contextlib.contextmanager
def _artifact_handler(target_directory, artifact_patterns):
_logger.debug(
'Artifacts will be searched for in directories matching {} patterns and placed in {}'
Expand All @@ -45,7 +45,7 @@ def _artifact_handler(target_directory, artifact_patterns):
target_name = os.path.join(target_directory, "_".join(path.split('/')))
_logger.debug('Copying artifact {} to {}'.format(path, target_name))
if os.path.isdir(path):
shutil.copytree(path, target_name, dirs_exist_ok=True)
shutil.copytree(path, target_name)
else:
shutil.copyfile(path, target_name)

Expand All @@ -68,8 +68,8 @@ class _CommonOptions:
'--artifact-patterns',
default=('**/build/test-results', '**/build/reports'),
help=
'Shell-style artifact patterns that are copied into `artifact-target-dir`. '
'Can be specified multiple times.',
'Shell-style artifact patterns that are copied into `artifact-target-dir`.'\
'Can be specified multiple times.',
multiple=True,
type=str,
)
Expand All @@ -83,34 +83,30 @@ def main(options, **kwargs):
setattr(options, k, v)


def ci_command(name=None, cls=click.Command, group=main):
def ci_command(name=None):
"""Decorator to use for CI commands.

The differences from the standard @click.command are:

* Allows configuration of artifacts that are uploaded for later viewing in CI.
* Registers the command automatically.
* Registers the command automatically

:param name: Optional name of the task. Defaults to the function name that is decorated with this decorator.
:param cls: Specifies whether the func is a command or a command group. Defaults to `click.Command`.
:param group: Specifies the group the command belongs to. Defaults to the `main` command group.
:param name: Optional name of the task. Defaults to the function name that is decorated with
this decorator.
"""

def ci_command(f):
actual_name = f.__name__ if name is None else name

@click.command(name=actual_name, cls=cls, help=f.__doc__)
@main.command(name=actual_name, help=f.__doc__)
@_pass_options
@click.pass_context
def new_func(ctx, options, *args, **kwargs):
with _artifact_handler(
options.artifact_target_dir,
options.artifact_patterns,
) if cls is click.Command else nullcontext():
options.artifact_patterns):
return ctx.invoke(f, *args, **kwargs)

group.add_command(new_func)

return functools.update_wrapper(new_func, f)

return ci_command
4 changes: 2 additions & 2 deletions ci/fireci/fireci/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def discover():
Note: plugins *must* define the `firebaseplugins` package as a namespace package.
See: https://packaging.python.org/guides/packaging-namespace-packages/
"""
modules = pkgutil.walk_packages(fireciplugins.__path__,
fireciplugins.__name__ + ".")
modules = pkgutil.iter_modules(fireciplugins.__path__,
fireciplugins.__name__ + ".")
for _, name, _ in modules:
importlib.import_module(name)
Loading