Skip to content

Commit 4d3a7bd

Browse files
Merge pull request #76 from data-integrations/driveE2E
google drive e2e tests
2 parents 1013bcd + 48470e9 commit 4d3a7bd

24 files changed

+1248
-1
lines changed

.github/workflows/e2e.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Copyright © 2025 Cask Data, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
3+
# use this file except in compliance with the License. You may obtain a copy of
4+
# the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations under
10+
# the License.
11+
12+
# This workflow will build a Java project with Maven
13+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
14+
# Note: Any changes to this workflow would be used only after merging into develop
15+
name: Build e2e tests
16+
17+
on:
18+
push:
19+
branches: [ develop, release/** ]
20+
pull_request:
21+
branches: [ develop, release/** ]
22+
types: [ opened, synchronize, reopened, labeled ]
23+
workflow_dispatch:
24+
25+
jobs:
26+
build-e2e-tests:
27+
runs-on: k8s-runner-e2e
28+
# We allow builds:
29+
# 1) When triggered manually
30+
# 2) When it's a merge into a branch
31+
# 3) For PRs that are labeled as build and
32+
# - It's a code change
33+
# - A build label was just added
34+
# A bit complex, but prevents builds when other labels are manipulated
35+
if: >
36+
github.event_name == 'workflow_dispatch'
37+
|| github.event_name == 'push'
38+
|| (contains(github.event.pull_request.labels.*.name, 'build')
39+
&& (github.event.action != 'labeled' || github.event.label.name == 'build')
40+
)
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
path: plugin
46+
ref: ${{ github.event.workflow_run.head_sha }}
47+
48+
- name: Checkout e2e test repo
49+
uses: actions/checkout@v4
50+
with:
51+
repository: cdapio/cdap-e2e-tests
52+
path: e2e
53+
54+
- name: Cache
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/.m2/repository
58+
key: ${{ runner.os }}-maven-${{ github.workflow }}-${{ hashFiles('**/pom.xml') }}
59+
restore-keys: |
60+
${{ runner.os }}-maven-${{ github.workflow }}
61+
62+
- name: Run tests
63+
run: python3 e2e/src/main/scripts/run_e2e_test.py
64+
65+
- name: Upload debug files
66+
uses: actions/upload-artifact@v4
67+
if: always()
68+
with:
69+
name: Debug files
70+
path: ./**/target/e2e-debug
71+
72+
- name: Upload reports to GCS
73+
uses: google-github-actions/upload-cloud-storage@v2
74+
if: always()
75+
with:
76+
path: ./plugin/target/cucumber-reports
77+
destination: e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }}
78+
79+
- name: Cucumber Report URL
80+
if: always()
81+
run: echo "https://storage.googleapis.com/e2e-tests-cucumber-reports/${{ github.event.repository.name }}/${{ github.ref }}/cucumber-reports/advanced-reports/cucumber-html-reports/overview-features.html"
82+

pom.xml

Lines changed: 218 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
<powermock.version>1.6.5</powermock.version>
4343
<sheets-api.version>v4-rev612-1.25.0</sheets-api.version>
4444
<jackson.databind.version>2.13.4.2</jackson.databind.version>
45+
<api-client.version>1.31.1</api-client.version>
46+
<surefire.version>2.18.1</surefire.version>
47+
<build-helper-maven.version>3.3.0</build-helper-maven.version>
48+
<failsafe.version>3.0.0-M5</failsafe.version>
49+
<cucumber-reporting.version>5.5.0</cucumber-reporting.version>
50+
<guava-e2e.version>31.0.1-jre</guava-e2e.version>
51+
<e2e-framework.version>0.5.0-SNAPSHOT</e2e-framework.version>
52+
<central-publishing-maven.version>0.8.0</central-publishing-maven.version>
53+
<maven-source.version>2.2.1</maven-source.version>
54+
<maven-javadoc.version>2.9.1</maven-javadoc.version>
55+
<maven-gpg.version>1.5</maven-gpg.version>
4556
</properties>
4657

4758
<repositories>
@@ -80,15 +91,32 @@
8091
<version>${cdap.version}</version>
8192
<scope>provided</scope>
8293
</dependency>
94+
<dependency>
95+
<groupId>com.google.api-client</groupId>
96+
<artifactId>google-api-client</artifactId>
97+
<version>${api-client.version}</version>
98+
</dependency>
8399
<dependency>
84100
<groupId>com.google.apis</groupId>
85101
<artifactId>google-api-services-drive</artifactId>
86102
<version>${drive-api.version}</version>
103+
<exclusions>
104+
<exclusion>
105+
<groupId>com.google.api-client</groupId>
106+
<artifactId>google-api-client</artifactId>
107+
</exclusion>
108+
</exclusions>
87109
</dependency>
88110
<dependency>
89111
<groupId>com.google.apis</groupId>
90112
<artifactId>google-api-services-sheets</artifactId>
91113
<version>${sheets-api.version}</version>
114+
<exclusions>
115+
<exclusion>
116+
<groupId>com.google.api-client</groupId>
117+
<artifactId>google-api-client</artifactId>
118+
</exclusion>
119+
</exclusions>
92120
</dependency>
93121
<!-- https://mvnrepository.com/artifact/com.google.auth/google-auth-library-oauth2-http -->
94122
<dependency>
@@ -426,4 +454,193 @@
426454
</plugins>
427455
</build>
428456

429-
</project>
457+
<profiles>
458+
<profile>
459+
<id>e2e-tests</id>
460+
<properties>
461+
<testSourceLocation>src/e2e-test/java</testSourceLocation>
462+
</properties>
463+
<build>
464+
<testResources>
465+
<testResource>
466+
<directory>src/e2e-test/resources</directory>
467+
</testResource>
468+
</testResources>
469+
<plugins>
470+
<plugin>
471+
<groupId>org.apache.maven.plugins</groupId>
472+
<artifactId>maven-surefire-plugin</artifactId>
473+
<version>${surefire.version}</version>
474+
<configuration>
475+
<skipTests>true</skipTests>
476+
</configuration>
477+
</plugin>
478+
479+
<plugin>
480+
<groupId>org.codehaus.mojo</groupId>
481+
<artifactId>build-helper-maven-plugin</artifactId>
482+
<version>${build-helper-maven.version}</version>
483+
<executions>
484+
<execution>
485+
<id>add-e2e-test-source</id>
486+
<phase>generate-test-sources</phase>
487+
<goals>
488+
<goal>add-test-source</goal>
489+
</goals>
490+
<configuration>
491+
<sources>
492+
<source>src/e2e-test/java</source>
493+
</sources>
494+
</configuration>
495+
</execution>
496+
</executions>
497+
</plugin>
498+
499+
<plugin>
500+
<groupId>org.apache.maven.plugins</groupId>
501+
<artifactId>maven-failsafe-plugin</artifactId>
502+
<version>${failsafe.version}</version>
503+
<executions>
504+
<execution>
505+
<id>integration-tests</id>
506+
<phase>integration-test</phase>
507+
<goals>
508+
<goal>integration-test</goal>
509+
</goals>
510+
<configuration>
511+
<includes>
512+
<include>**/TestRunner*.class</include>
513+
</includes>
514+
</configuration>
515+
</execution>
516+
</executions>
517+
</plugin>
518+
519+
<plugin>
520+
<groupId>net.masterthought</groupId>
521+
<artifactId>maven-cucumber-reporting</artifactId>
522+
<version>${cucumber-reporting.version}</version>
523+
<executions>
524+
<execution>
525+
<id>execution</id>
526+
<phase>verify</phase>
527+
<goals>
528+
<goal>generate</goal>
529+
</goals>
530+
<configuration>
531+
<projectName>Cucumber Reports</projectName> <!-- Replace with project name -->
532+
<outputDirectory>target/cucumber-reports/advanced-reports</outputDirectory>
533+
<buildNumber>1</buildNumber>
534+
<skip>false</skip>
535+
<inputDirectory>${project.build.directory}/cucumber-reports</inputDirectory>
536+
<jsonFiles> <!-- supports wildcard or name pattern -->
537+
<param>**/*.json</param>
538+
</jsonFiles> <!-- optional, defaults to outputDirectory if not specified -->
539+
<classificationDirectory>${project.build.directory}/cucumber-reports</classificationDirectory>
540+
<checkBuildResult>true</checkBuildResult>
541+
</configuration>
542+
</execution>
543+
</executions>
544+
</plugin>
545+
</plugins>
546+
</build>
547+
<dependencyManagement>
548+
<dependencies>
549+
<dependency>
550+
<groupId>com.google.guava</groupId>
551+
<artifactId>guava</artifactId>
552+
<version>${guava-e2e.version}</version>
553+
</dependency>
554+
</dependencies>
555+
</dependencyManagement>
556+
<dependencies>
557+
<dependency>
558+
<groupId>io.cdap.tests.e2e</groupId>
559+
<artifactId>cdap-e2e-framework</artifactId>
560+
<version>${e2e-framework.version}</version>
561+
<scope>test</scope>
562+
</dependency>
563+
</dependencies>
564+
</profile>
565+
<profile>
566+
<id>release</id>
567+
<build>
568+
<plugins>
569+
<plugin>
570+
<groupId>org.sonatype.central</groupId>
571+
<artifactId>central-publishing-maven-plugin</artifactId>
572+
<version>${central-publishing-maven.version}</version>
573+
<extensions>true</extensions>
574+
<configuration>
575+
<publishingServerId>sonatype.release</publishingServerId>
576+
<autoPublish>false</autoPublish>
577+
<ignorePublishedComponents>true</ignorePublishedComponents>
578+
</configuration>
579+
</plugin>
580+
<!-- Source JAR -->
581+
<plugin>
582+
<groupId>org.apache.maven.plugins</groupId>
583+
<artifactId>maven-source-plugin</artifactId>
584+
<version>${maven-source.version}</version>
585+
<configuration>
586+
<excludeResources>true</excludeResources>
587+
</configuration>
588+
<executions>
589+
<execution>
590+
<id>attach-sources</id>
591+
<phase>package</phase>
592+
<goals>
593+
<goal>jar-no-fork</goal>
594+
</goals>
595+
</execution>
596+
</executions>
597+
</plugin>
598+
599+
<!-- Javadoc jar -->
600+
<plugin>
601+
<groupId>org.apache.maven.plugins</groupId>
602+
<artifactId>maven-javadoc-plugin</artifactId>
603+
<version>${maven-javadoc.version}</version>
604+
<configuration>
605+
<additionalparam>-Xdoclint:none</additionalparam>
606+
<failOnError>false</failOnError>
607+
<links>
608+
<link>http://download.oracle.com/javase/${jee.version}/docs/api/</link>
609+
</links>
610+
<doctitle>${project.name} ${project.version}</doctitle>
611+
<bottom>
612+
<![CDATA[Copyright &#169; {currentYear} <a href="http://cdap.io" target="_blank">CDAP</a> Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>.]]>
613+
</bottom>
614+
</configuration>
615+
<executions>
616+
<execution>
617+
<id>attach-javadoc</id>
618+
<phase>package</phase>
619+
<goals>
620+
<goal>jar</goal>
621+
</goals>
622+
</execution>
623+
</executions>
624+
</plugin>
625+
626+
<plugin>
627+
<groupId>org.apache.maven.plugins</groupId>
628+
<artifactId>maven-gpg-plugin</artifactId>
629+
<version>${maven-gpg.version}</version>
630+
<configuration>
631+
<passphrase>${gpg.passphrase}</passphrase>
632+
<useAgent>${gpg.useagent}</useAgent>
633+
</configuration>
634+
<executions>
635+
<execution>
636+
<goals>
637+
<goal>sign</goal>
638+
</goals>
639+
</execution>
640+
</executions>
641+
</plugin>
642+
</plugins>
643+
</build>
644+
</profile>
645+
</profiles>
646+
</project>

0 commit comments

Comments
 (0)