Skip to content

[jit] gtest-ify test_alias_analysis.cpp - #45018

Closed
suo wants to merge 5 commits into
gh/suo/355/basefrom
gh/suo/355/head
Closed

suo wants to merge 5 commits into
gh/suo/355/basefrom
gh/suo/355/head

Conversation

@suo

@suo suo commented Sep 19, 2020 •

Copy link
Copy Markdown
Member

Stack from ghstack:

Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:

  1. You don't need to register your test twice (once to define it, once
    in tests.h).
  2. Consequently, it's easier to have many individual test cases.
    Failures can be reported independently (rather than having huge
    functions to test entire modules.
  3. Some nicer testing APIs, notably test fixtures.

Differential Revision: D23802297

Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:
1. You don't need to register your test twice (once to define it, once
in tests.h).
2. Consequently, it's easier to have many individual test cases.
Failures can be reported independently (rather than having huge
functions to test entire modules.
3. Some nicer testing APIs, notably test fixtures.

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 19, 2020
@dr-ci

dr-ci Bot commented Sep 19, 2020 •

Copy link
Copy Markdown

💊 CI failures summary and remediations

As of commit 5bef589 (more details on the Dr. CI page):


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 15 times.

Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:
1. You don't need to register your test twice (once to define it, once
in tests.h).
2. Consequently, it's easier to have many individual test cases.
Failures can be reported independently (rather than having huge
functions to test entire modules.
3. Some nicer testing APIs, notably test fixtures.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 19, 2020
See #45018 for context.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 19, 2020
See #45018 for context.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 19, 2020
See #45018 for context.

ghstack-source-id: 6e7f846
Pull Request resolved: #45020
Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:
1. You don't need to register your test twice (once to define it, once
in tests.h).
2. Consequently, it's easier to have many individual test cases.
Failures can be reported independently (rather than having huge
functions to test entire modules.
3. Some nicer testing APIs, notably test fixtures.

Differential Revision: [D23802297](https://our.internmc.facebook.com/intern/diff/D23802297)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 19, 2020
See #45018 for context.

ghstack-source-id: 26c4798
Pull Request resolved: #45020
@codecov

codecov Bot commented Sep 19, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #45018 into gh/suo/355/base will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           gh/suo/355/base   #45018      +/-   ##
===================================================
- Coverage            67.84%   67.84%   -0.01%     
===================================================
  Files                  384      384              
  Lines                49984    49984              
===================================================
- Hits                 33912    33911       -1     
- Misses               16072    16073       +1     
Impacted Files Coverage Δ
torch/testing/_internal/expecttest.py 77.55% <0.00%> (-1.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da7863f...5bef589. Read the comment docs.

Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:
1. You don't need to register your test twice (once to define it, once
in tests.h).
2. Consequently, it's easier to have many individual test cases.
Failures can be reported independently (rather than having huge
functions to test entire modules.
3. Some nicer testing APIs, notably test fixtures.

Differential Revision: [D23802297](https://our.internmc.facebook.com/intern/diff/D23802297)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 21, 2020
See #45018 for context.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 21, 2020
See #45018 for context.

ghstack-source-id: f955286
Pull Request resolved: #45055
Now that #44795 has landed, we
can convert the bulk of our cpp tests to use gtest APIs. Eventually
we'll want to get rid of our weird harness for cpp tests entirely in
favor of using regular gtest everywhere. This PR demonstrates some of
the benefits of this approach:
1. You don't need to register your test twice (once to define it, once
in tests.h).
2. Consequently, it's easier to have many individual test cases.
Failures can be reported independently (rather than having huge
functions to test entire modules.
3. Some nicer testing APIs, notably test fixtures.

Differential Revision: [D23802297](https://our.internmc.facebook.com/intern/diff/D23802297)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 21, 2020
See #45018 for context.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 21, 2020
See #45018 for context.

ghstack-source-id: b2fb7e9
Pull Request resolved: #45055
@suo
suo requested a review from ZolotukhinM September 21, 2020 17:05
suo added a commit that referenced this pull request Sep 21, 2020
suo added a commit that referenced this pull request Sep 21, 2020
See #45018 for context.

ghstack-source-id: 7f94cc6
Pull Request resolved: #45055

@ZolotukhinM ZolotukhinM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (I assumed that all tests are preserved and didn't check that)!

set(JIT_TEST_SRCS ${JIT_TEST_SRCS} PARENT_SCOPE)

add_executable(test_jit
${TORCH_ROOT}/test/cpp/common/main.cpp

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we include main.cpp into JIT_TEST_SRCS?

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@suo merged this pull request in 42af2c7.

facebook-github-bot pushed a commit that referenced this pull request Sep 23, 2020
Summary:
Pull Request resolved: #45019

See #45018 for context.

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D23802298

Pulled By: suo

fbshipit-source-id: 0e36d095d4d81dcd5ebe6d56b3dc469d6d5482d0
facebook-github-bot pushed a commit that referenced this pull request Sep 23, 2020
Summary:
Pull Request resolved: #45020

See #45018 for context.

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D23802296

Pulled By: suo

fbshipit-source-id: 20c9798a414e9ba30869a862012cbdee0613c8b1
facebook-github-bot pushed a commit that referenced this pull request Sep 23, 2020
Summary:
Pull Request resolved: #45055

See #45018 for context.

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D23811085

Pulled By: suo

fbshipit-source-id: 45008e41f2394d2ba319745b0340392e1b3d3172
suo added a commit that referenced this pull request Sep 24, 2020
Reland of #45055 and
#45020

See #45018 for context.

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 24, 2020
Reland of #45055 and
#45020

See #45018 for context.

ghstack-source-id: 8e86ac3
Pull Request resolved: #45249
facebook-github-bot pushed a commit that referenced this pull request Sep 24, 2020
Summary:
Pull Request resolved: #45249

Reland of #45055 and
#45020

See #45018 for context.

Test Plan: Imported from OSS

Reviewed By: jamesr66a

Differential Revision: D23892645

Pulled By: suo

fbshipit-source-id: e7fe58d5e1a5a0c44f4e2aec9694145afabde0fd
suo added a commit that referenced this pull request Sep 24, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 24, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 24, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 24, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 25, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
suo added a commit that referenced this pull request Sep 25, 2020
Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Differential Revision: [D23901392](https://our.internmc.facebook.com/intern/diff/D23901392)

[ghstack-poisoned]
@facebook-github-bot
facebook-github-bot deleted the gh/suo/355/head branch September 25, 2020 14:17
facebook-github-bot pushed a commit that referenced this pull request Sep 25, 2020
Summary:
Pull Request resolved: #45264

Context for why we are porting to gtest in: #45018.

This PR completes the process of porting and removes unused files/macros.

Test Plan: Imported from OSS

Reviewed By: ZolotukhinM

Differential Revision: D23901392

Pulled By: suo

fbshipit-source-id: 89526890e1a49462f3f77718f4ee273c5bc578ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants