Skip to content
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

GH-44062: [Dev][Archery][Integration] Reduce needless test matrix #44099

Merged
merged 8 commits into from
Sep 16, 2024

Conversation

kou
Copy link
Member

@kou kou commented Sep 13, 2024

Rationale for this change

If we enable C++, Java and Rust, we use the following patterns:

Producer Consumer
C++ C++
C++ Java
C++ Rust
Java C++
Java Java
Java Rust
Rust C++
Rust Java
Rust Rust

In apache/arrow, the following patterns are redundant because they should be done in apache/arrow-rs:

Producer Consumer
Rust Rust

In apache/arror-rs, the following patterns are redundant because they should be done in apache/arrow:

Producer Consumer
C++ C++
C++ Java
Java C++
Java Java

What changes are included in this PR?

Add --target-languages option. We can specify target languages by this. Here are expected usages:

In apache/arrow:

  • --target-languages=cpp,csharp,go,java,js

In apache/arrow-rs

  • --target-languages=rust

Here is an example in apache/arrow-rs:

Used matrix:

Producer Consumer
Rust Rust
Rust C++
Rust C#
Rust Go
Rust Java
Rust JS
Rust nanoarrow
C++ Rust
C# Rust
Go Rust
Java Rust
JS Rust
nanoarrow Rust

If no --target-languages is specified, all enabled languages are the target languages. (The same as the current behavior.)

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

If we enable C++, Java and Rust, we use the following patterns:

| Producer | Consumer |
|----------|----------|
| C++      | C++      |
| C++      | Java     |
| C++      | Rust     |
| Java     | C++      |
| Java     | Java     |
| Java     | Rust     |
| Rust     | C++      |
| Rust     | Java     |
| Rust     | Rust     |

In apache/arrow, the following patterns are redundant because they
should be done in apache/arrow-rs:

| Producer | Consumer |
|----------|----------|
| Rust     | Rust     |

In apache/arror-rs, the following patterns are redundant because they
should be done in apache/arrow:

| Producer | Consumer |
|----------|----------|
| C++      | C++      |
| C++      | Java     |
| Java     | C++      |
| Java     | Java     |

Add `--target-language` option. We can specify target languages by
this. (We can specify `--target-language` multiple times.) Here are
expected usages:

In apache/arrow:
* `--target-language=cpp`
* `--target-language=csharp`
* `--target-language=go`
* `--target-language=java`
* `--target-language=js`

In apache/arrow-rs
* `--target-language=rust`

Here is an example in apache/arrow-rs:

T: Languages specified by `--target-language`
   * rust
O: Languages not specified by `--target-language`
   * cpp
   * csharp
   * go
   * java
   * js
   * nanoarrow

Used matrix:

| Producer | Consumer |
|----------|----------|
| Rust     | Rust     |
| Rust     | C++      |
| Rust     | C#       |
| Rust     | Go       |
| Rust     | Java     |
| Rust     | JS       |
| Rust     | nanoarrow|
| C++      | Rust     |
| C#       | Rust     |
| Go       | Rust     |
| Java     | Rust     |
| JS       | Rust     |
| nanoarrow| Rust     |
Copy link

⚠️ GitHub issue #44062 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Sep 13, 2024
@kou
Copy link
Member Author

kou commented Sep 13, 2024

Hmm. "Rust -> Rust" still exists...:

https://github.com/apache/arrow/actions/runs/10844206629/job/30092647347?pr=44099#step:9:11984

Integration: Test: IPC: Rust -> Rust

--with-js=$([ "$ARROW_INTEGRATION_JS" == "ON" ] && echo "1" || echo "0") \
--target-language=js \
Copy link
Member Author

Choose a reason for hiding this comment

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

This file is used by apache/arrow-rs too.
So embedding --target-language here isn't a good approach.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Sep 13, 2024
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 13, 2024
@kou
Copy link
Member Author

kou commented Sep 14, 2024

+1

No "Rust -> Rust":

https://github.com/apache/arrow/actions/runs/10858710101/job/30137035840?pr=44099#step:9:6499

Integration: Test: IPC: C++ -> C++
Integration: Test: IPC: C++ -> Java
Integration: Test: IPC: C++ -> JS
Integration: Test: IPC: C++ -> C#
Integration: Test: IPC: C++ -> Go
Integration: Test: IPC: Java -> C++
Integration: Test: IPC: Java -> Java
Integration: Test: IPC: Java -> JS
Integration: Test: IPC: Java -> C#
Integration: Test: IPC: Java -> Go
Integration: Test: IPC: JS -> C++
Integration: Test: IPC: JS -> Java
Integration: Test: IPC: JS -> JS
Integration: Test: IPC: JS -> C#
Integration: Test: IPC: JS -> Go
Integration: Test: IPC: C# -> C++
Integration: Test: IPC: C# -> Java
Integration: Test: IPC: C# -> JS
Integration: Test: IPC: C# -> C#
Integration: Test: IPC: C# -> Go
Integration: Test: IPC: Go -> C++
Integration: Test: IPC: Go -> Java
Integration: Test: IPC: Go -> JS
Integration: Test: IPC: Go -> C#
Integration: Test: IPC: Go -> Go
Integration: Test: IPC: C++ -> Rust
Integration: Test: IPC: Java -> Rust
Integration: Test: IPC: JS -> Rust
Integration: Test: IPC: C# -> Rust
Integration: Test: IPC: Go -> Rust
Integration: Test: IPC: Rust -> C++
Integration: Test: IPC: Rust -> Java
Integration: Test: IPC: Rust -> JS
Integration: Test: IPC: Rust -> C#
Integration: Test: IPC: Rust -> Go

@kou kou merged commit 38b0c79 into apache:main Sep 16, 2024
14 checks passed
@kou kou removed the awaiting change review Awaiting change review label Sep 16, 2024
@kou kou deleted the ci-integration-reduce-matrix branch September 16, 2024 23:53
kou added a commit that referenced this pull request Sep 17, 2024
### Rationale for this change

#44099 included debug prints.

### What changes are included in this PR?

Remove debug prints.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 38b0c79.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 5 possible false positives for unstable benchmarks that are known to sometimes produce them.

Comment on lines +747 to +749
@click.option('--target-languages', default='',
help=('Target languages in this integration tests'),
envvar="ARCHERY_INTEGRATION_TARGET_LANGUAGES")
Copy link
Member

Choose a reason for hiding this comment

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

Uh, can the help string be more explanatory? It's really not possible to understand what this does from the current wording.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. But is the help string a suitable location to explain it more with click API?
In general, --help output uses a simple one-line (or a few lines) per option.

Copy link
Member

Choose a reason for hiding this comment

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

Then it can be explained in the command's help: https://click.palletsprojects.com/en/8.1.x/api/#click.Command

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I'll use it: GH-44158

tempdir = tempdir or tempfile.mkdtemp(prefix='arrow-integration-')
print(["before", target_languages])
Copy link
Member

Choose a reason for hiding this comment

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

You should remove those print calls

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes... I've removed it: #44140

tempdir = tempdir or tempfile.mkdtemp(prefix='arrow-integration-')
print(["before", target_languages])
target_languages = list(filter(len, target_languages.split(",")))
Copy link
Member

Choose a reason for hiding this comment

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

Why the filter call?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because "".split(",") returns [""] not [].
(I surprised the Python behavior because "".split(",") returns [] with Ruby.)

Copy link
Member

Choose a reason for hiding this comment

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

Why would you pass ,? It's ok to make it an error IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because --target-languages=cpp,java is an input. We need to extract cpp and java from cpp,java.

I know that click supports --target-language=cpp --target-languages=java style. But reusing ci/scripts/integration_arrow.sh in apache/arrow, apache/arrow-rs, apache/arrow-nanoarrow and apache/arrow-go is difficult with the style. Entirely overwritable --target-languages=cpp,java style is easy to reusable.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you're talking about the empty string, sorry, I had misread.
Then I would suggest the much more idiomatic

Suggested change
target_languages = list(filter(len, target_languages.split(",")))
target_languages = target_languages.split(",") if target_languages else []

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I'll use it in #44156.

@@ -744,6 +744,9 @@ def _set_default(opt, default):
@click.option('--with-rust', type=bool, default=False,
help='Include Rust in integration tests',
envvar="ARCHERY_INTEGRATION_WITH_RUST")
@click.option('--target-languages', default='',
Copy link
Member

Choose a reason for hiding this comment

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

"Languages" is not really right here, as nanoarrow for example is not a language. "Implementations" perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. I'll rename it: GH-44155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes Awaiting changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants