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

Packit: add more test groups + define smoke #46

Merged
merged 5 commits into from
Sep 17, 2024
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
42 changes: 37 additions & 5 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- job: tests
trigger: pull_request
# Suffix for job name
identifier: "sql-example"
identifier: "flink-sql-example"
targets:
# This target is not used at all by our tests, but it has to be one of the available - https://packit.dev/docs/configuration/#aliases
- centos-stream-9-x86_64
Expand All @@ -39,21 +39,53 @@ jobs:
manual_trigger: true
env: { IP_FAMILY: ipv4 }
labels:
- sql-example
- flink-sql-example
tf_extra_params:
test:
tmt:
name: sql-example
name: flink-sql-example
###############################################################################################
- job: tests
trigger: pull_request
# Suffix for job name
identifier: "flink-all"
targets:
- centos-stream-9-x86_64
skip_build: true
manual_trigger: true
env: { IP_FAMILY: ipv4 }
labels:
- flink-all
tf_extra_params:
test:
tmt:
name: flink-all
###############################################################################################
- job: tests
trigger: pull_request
# Suffix for job name
identifier: "smoke"
targets:
- centos-stream-9-x86_64
skip_build: true
manual_trigger: true
env: { IP_FAMILY: ipv4 }
labels:
- smoke
tf_extra_params:
test:
tmt:
name: smoke
###############################################################################################
- job: tests
trigger: commit
branch: main
identifier: "verify-main"
identifier: "smoke"
targets:
- centos-stream-9-x86_64
skip_build: true
env: { IP_FAMILY: ipv4 }
tf_extra_params:
test:
tmt:
name: verify
name: smoke
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $ ./mvnw verify -P test

Run specific tag.
```bash
$ ./mvnw verify -P test -Dgroups=sql-example
$ ./mvnw verify -P test -Dgroups=flink-sql-example
```

Run specific test class or test
Expand All @@ -49,11 +49,18 @@ $ ./mvnw verify -P test -Dit.tests=io.streams.e2e.flink.sql.SqlExampleST#testFli
```

## Test configuration
TODO
- To configure sql runner image set env var `SQL_RUNNER_IMAGE`

## Run Packit CI
If PR is opened, you can use packit for run you tests on top of kind cluster.
To run Packit CI, just make comment with following text...
```
/packit test --labels sql-example
# run sql example test
/packit test --labels flink-sql-example

# run all flink tests
/packit test --labels flink-all

# run smoke tests
/packit test --labels smoke
```
4 changes: 2 additions & 2 deletions src/main/java/io/streams/constants/TestTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public interface TestTags {
String SMOKE = "smoke";
String SQL_EXAMPLE = "sql-example";
String SQL_RUNNER = "sql-runner";
String FLINK_SQL_EXAMPLE = "flink-sql-example";
String FLINK_SQL_RUNNER = "flink-sql-runner";
String FLINK = "flink";
String DUMMY = "dummy";
}
4 changes: 2 additions & 2 deletions src/test/java/io/streams/e2e/flink/sql/SqlExampleST.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
import java.util.concurrent.CompletableFuture;

import static io.streams.constants.TestTags.FLINK;
import static io.streams.constants.TestTags.SQL_EXAMPLE;
import static io.streams.constants.TestTags.FLINK_SQL_EXAMPLE;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Tag(FLINK)
@Tag(SQL_EXAMPLE)
@Tag(FLINK_SQL_EXAMPLE)
public class SqlExampleST extends Abstract {

String namespace = "flink";
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/io/streams/e2e/flink/sql/SqlJobRunnerST.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
import java.util.concurrent.CompletableFuture;

import static io.streams.constants.TestTags.FLINK;
import static io.streams.constants.TestTags.SQL_RUNNER;
import static io.streams.constants.TestTags.FLINK_SQL_RUNNER;
import static io.streams.constants.TestTags.SMOKE;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Tag(FLINK)
@Tag(SQL_RUNNER)
@Tag(FLINK_SQL_RUNNER)
public class SqlJobRunnerST extends Abstract {

String namespace = "flink-filter";
Expand All @@ -60,6 +61,7 @@ void prepareOperators() throws IOException {
}

@Test
@Tag(SMOKE)
void testFlinkSqlRunnerSimpleFilter() {
// Create namespace
KubeResourceManager.getInstance().createOrUpdateResourceWithWait(
Expand Down
18 changes: 15 additions & 3 deletions tmt/plans/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,20 @@ finish:
test:
- verify

/sql-example:
summary: Run SQL example tests
/smoke:
summary: Run smoke tests
discover+:
test:
- sql-example
- smoke

/flink-sql-example:
summary: Run Flink SQL example tests
discover+:
test:
- flink-sql-example

/flink-all:
summary: Run all flink related tests
discover+:
test:
- flink-all
18 changes: 16 additions & 2 deletions tmt/tests/streams-e2e/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@ environment:
environment+:
TEST_GROUPS: dummy

/sql-example:
/smoke:
summary: Run smoke tests
duration: 60m
tier: 1
environment+:
TEST_GROUPS: smoke

/flink-sql-example:
summary: Run flink sql example streams-e2e suite
duration: 60m
tier: 1
environment+:
TEST_GROUPS: sql-example
TEST_GROUPS: flink-sql-example

/flink-all:
summary: Run flink streams-e2e suite
duration: 180m
tier: 1
environment+:
TEST_GROUPS: flink