Skip to content

Commit

Permalink
chore: Introduce Maven module for YAKS tests
Browse files Browse the repository at this point in the history
- Manage YAKS version in Maven POM.xml
- Run tests from Maven build
- Run tests from Java IDE
- Enables syntax highlighting and code completion
  • Loading branch information
christophd committed Dec 8, 2023
1 parent 3d3fbd1 commit b25737b
Show file tree
Hide file tree
Showing 95 changed files with 515 additions and 358 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Deploy to ASF Snapshots Repository
# Deploy both artifacts and sources (may be required by Camel K)
# Deploy both artifacts and sources (maybe required by Camel K)
run: |
./mvnw ${MAVEN_ARGS} clean deploy -DskipTests -DskipITs --settings .github/asf-deploy-settings.xml
21 changes: 3 additions & 18 deletions .github/workflows/yaks-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

env:
YAKS_VERSION: 0.17.1

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -59,18 +56,7 @@ jobs:
cache: 'maven'
- name: Build Kamelet libraries
run: |
./mvnw clean install -DskipTests
- name: Get YAKS CLI
run: |
curl --fail -L --silent https://github.com/citrusframework/yaks/releases/download/v${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz -o yaks.tar.gz
mkdir -p _yaks
tar -zxf yaks.tar.gz --directory ./_yaks
sudo mv ./_yaks/yaks /usr/local/bin/
rm yaks.tar.gz
rm -r _yaks
- name: Info
run: |
yaks version
./mvnw clean install -DskipTests -DskipITs
- name: YAKS Tests
run: |
echo "Install JBang via SDKMAN"
Expand All @@ -87,10 +73,9 @@ jobs:
echo "Running YAKS tests for Kamelets"
cd test
make yaks
./mvnw clean verify -pl :camel-kamelets-itest -Denable.yaks.tests
- uses: actions/upload-artifact@v3
if: failure()
with:
name: dumps
path: test/**/.yaks-jbang
path: tests/camel-kamelets-itest/.yaks-jbang
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<module>library/kamelets-maven-plugin</module>
<module>library/camel-kamelets-utils</module>
<module>library/camel-kamelets-bom</module>
<module>tests/camel-kamelets-itest</module>
</modules>

<properties>
Expand All @@ -50,6 +51,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-failsafe-plugin.version>3.2.2</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
Expand All @@ -63,6 +65,10 @@
<camel.version>4.2.0</camel.version>
<camel.k.crds.version>2.0.1</camel.k.crds.version>

<citrus.version>4.0.2</citrus.version>
<cucumber.version>7.14.0</cucumber.version>
<yaks.version>0.17.1</yaks.version>

<!-- Versions used inside Kamelets (add them also to the dependencyManagement section and the groovy script below) -->
<!-- These properties must keep this same format "version.<groupId>.<artifactId>" -->
<version.org.apache.commons.commons-dbcp2>2.11.0</version.org.apache.commons.commons-dbcp2>
Expand Down Expand Up @@ -258,6 +264,27 @@
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<failIfNoTests>false</failIfNoTests>
</configuration>
</execution>
</executions>
<configuration>
<failIfNoTests>false</failIfNoTests>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
42 changes: 0 additions & 42 deletions test/Makefile

This file was deleted.

22 changes: 0 additions & 22 deletions test/avro-data-type/avro-data-type.feature

This file was deleted.

23 changes: 0 additions & 23 deletions test/avro-serdes-action/User.avsc

This file was deleted.

22 changes: 0 additions & 22 deletions test/avro-serdes-action/avro-serdes-action.feature

This file was deleted.

41 changes: 0 additions & 41 deletions test/insert-field-action/yaks-config.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions test/rest-openapi-sink/yaks-config.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions test/timer-source/yaks-config.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions test/README.md → tests/camel-kamelets-itest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ You need the following tools to run the tests:
Once everything is set you just need to run

```console
make yaks
mvn verify -Denable.yaks.tests
```

This runs all available YAKS tests that are not marked as `@ignored`.

You can run individual tests when specifying its folder or feature file name.

```console
make yaks test=timer-source/timer-source.feature
mvn verify -Dcucumber.feature=aws/s3/aws-s3-to-http.feature -Denable.yaks.tests
```

The Makefile is a wrapper for the YAKS binary which is able to run the BDD Gherkin feature files.
You can also run YAKS tooling directly form your local machine.
You can run the tests also from your favorite Java IDE.
By default, the YAKS tests use local runtime where Camel integrations, Kamelets, bindings and pipes are run with Camel JBang.
Loading

0 comments on commit b25737b

Please sign in to comment.