Commit 9e8d91eb authored by Jeremy Reizenstein's avatar Jeremy Reizenstein Committed by Facebook GitHub Bot
Browse files

restore build tests

Summary: A bad env var check meant these tests were not being run. Fix that, and fix the copyright test for the new message format.

Reviewed By: patricklabatut

Differential Revision: D29734562

fbshipit-source-id: a1a9bb68901b09c71c7b4ff81a04083febca8d50
parent bcee361d
...@@ -11,7 +11,7 @@ import numpy as np ...@@ -11,7 +11,7 @@ import numpy as np
import plotly.graph_objects as go import plotly.graph_objects as go
import torch import torch
from plotly.subplots import make_subplots from plotly.subplots import make_subplots
from pytorch3d.renderer import TexturesVertex, RayBundle, ray_bundle_to_ray_points from pytorch3d.renderer import RayBundle, TexturesVertex, ray_bundle_to_ray_points
from pytorch3d.renderer.camera_utils import camera_to_eye_at_up from pytorch3d.renderer.camera_utils import camera_to_eye_at_up
from pytorch3d.renderer.cameras import CamerasBase from pytorch3d.renderer.cameras import CamerasBase
from pytorch3d.structures import Meshes, Pointclouds, join_meshes_as_scene from pytorch3d.structures import Meshes, Pointclouds, join_meshes_as_scene
......
...@@ -15,7 +15,7 @@ from common_testing import get_pytorch3d_dir, get_tests_dir ...@@ -15,7 +15,7 @@ from common_testing import get_pytorch3d_dir, get_tests_dir
# This file groups together tests which look at the code without running it. # This file groups together tests which look at the code without running it.
# When running the tests inside conda's build, the code is not available. # When running the tests inside conda's build, the code is not available.
in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST" in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST"
in_re_worker = os.environ.get("INSIDE_RE_WORKER", "") is not None in_re_worker = os.environ.get("INSIDE_RE_WORKER") is not None
class TestBuild(unittest.TestCase): class TestBuild(unittest.TestCase):
...@@ -42,10 +42,7 @@ class TestBuild(unittest.TestCase): ...@@ -42,10 +42,7 @@ class TestBuild(unittest.TestCase):
extensions = ("py", "cu", "cuh", "cpp", "h", "hpp", "sh") extensions = ("py", "cu", "cuh", "cpp", "h", "hpp", "sh")
expect = ( expect = "Copyright (c) Facebook, Inc. and its affiliates.\n"
"Copyright (c) Facebook, Inc. and its affiliates."
+ " All rights reserved.\n"
)
files_missing_copyright_header = [] files_missing_copyright_header = []
...@@ -59,7 +56,7 @@ class TestBuild(unittest.TestCase): ...@@ -59,7 +56,7 @@ class TestBuild(unittest.TestCase):
continue continue
with open(path) as f: with open(path) as f:
firstline = f.readline() firstline = f.readline()
if firstline.startswith(("# -*-", "#!")): if firstline.startswith(("# -*-", "#!", "/*")):
firstline = f.readline() firstline = f.readline()
if not firstline.endswith(expect): if not firstline.endswith(expect):
files_missing_copyright_header.append(str(path)) files_missing_copyright_header.append(str(path))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment