Fix test ownership lint (#71554)

Summary:
I noticed after creating https://github.com/pytorch/pytorch/issues/71553 that the test ownership lint was not working properly.

This fixes my egregious mistake and fixes the broken lints.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71554

Reviewed By: malfet

Differential Revision: D33690732

Pulled By: janeyx99

fbshipit-source-id: ba4dfbcd98038e4afd63e326832ae40935d2501e
(cherry picked from commit 1bbc3d343a)
This commit is contained in:
Jane Xu 2022-01-21 10:20:23 -08:00 committed by PyTorch MergeBot
parent 3a77fb244b
commit b40dbdc49f
68 changed files with 89 additions and 46 deletions

View File

@ -22,7 +22,7 @@ from typing import List, Any
# Team/owner labels usually start with "module: " or "oncall: ", but the following are acceptable exceptions
ACCEPTABLE_OWNER_LABELS = ["NNC", "high priority"]
GLOB_EXCEPTIONS = [
"test/run_test.py"
"**/test/run_test.py"
]
PYTORCH_ROOT = Path(__file__).resolve().parent.parent.parent
@ -35,7 +35,7 @@ S3_RESOURCE_READ_ONLY = boto3.resource("s3", config=botocore.config.Config(signa
def get_all_test_files() -> List[Path]:
test_files = list(TEST_DIR.glob("**/test_*.py"))
test_files.extend(list(TEST_DIR.glob("**/*_test.py")))
return [f for f in test_files if any([fnmatch.fnmatch(str(f), g) for g in GLOB_EXCEPTIONS])]
return [f for f in test_files if not any([fnmatch.fnmatch(str(f), g) for g in GLOB_EXCEPTIONS])]
def get_pytorch_labels() -> Any:

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
from typing import Callable

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
import torch.nn as nn

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import unittest

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
import torch.nn as nn

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
from torch.testing._internal.common_fx2trt import InputTensorSpec, AccTestCase
from torch import nn
from torch.fx.experimental.fx_acc import acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import unittest

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
from torch.testing._internal.common_fx2trt import InputTensorSpec, AccTestCase
from torch import nn
import torch

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
from typing import Callable

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import operator

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
# Owner(s): ["oncall: aiacc"]
# Test that this import should not trigger any error when run
# in non-GPU hosts, or in any build mode.

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
from typing import List, Optional
import torch

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx
import torch.fx.experimental.fx_acc.acc_tracer as acc_tracer

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import logging
import torch.fx as fx

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: aiacc"]
import logging
# @manual=//caffe2:torch_fx2trt
from torch.fx.experimental.fx2trt.lower import Lowerer

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import torch.fx.experimental.fx_acc.acc_ops # noqa: F401
import torch

View File

@ -1,4 +1,4 @@
# Owner(s): ["oncall: fx"]
# Owner(s): ["oncall: aiacc"]
import operator

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: jit"]
from torch.testing._internal.jit_utils import JitTestCase
from torch._C import parse_ir
import torch

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: jit"]
from itertools import product
import unittest

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: jit"]
from itertools import product
from typing import Tuple
from unittest.case import expectedFailure

View File

@ -1,3 +1,4 @@
# Owner(s): ["oncall: jit"]
import torch
from torch.testing import FileCheck

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: mobile"]
import torch
import torch.utils.bundled_inputs
import io

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: quantization"]
import collections
import copy
import math

View File

@ -1,3 +1,4 @@
# Owner(s): ["oncall: quantization"]
# Copied from pytorch/test/fx/test_subgraph_rewriter.py
import os

View File

@ -1,3 +1,5 @@
# Owner(s): ["module: codegen"]
import torch
from torch.testing._internal.common_utils import TestCase, run_tests
from torch.testing._internal.logging_tensor import LoggingTensor, capture_logs, log_input

View File

@ -1,3 +1,5 @@
# Owner(s): ["module: masked operators"]
"""Tests for masked operations.
"""

View File

@ -1,3 +1,5 @@
# Owner(s): ["oncall: r2p"]
from torch.testing._internal.common_utils import (
TestCase, run_tests,
)