Skip to content

Commit

Permalink
Add basic github workflow for build and test
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <[email protected]>
  • Loading branch information
ankitkala committed Sep 8, 2021
1 parent dbb4a37 commit c2231a7
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Test and Build Workflow
# This workflow is triggered on pull requests to main branch
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

jobs:
build:
# Job name
name: Build Replication plugin
runs-on: ubuntu-latest
steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: 'main'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: |
./gradlew publishToMavenLocal -Dbuild.snapshot=true
# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
ref: 'main'
repository: 'opensearch-project/common-utils'
path: common-utils
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=true -Dopensearch.version=1.1.0-SNAPSHOT
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
- name: Build and run Replication tests
run: |
./gradlew clean release -Psecurity=true -Dbuild.snapshot=true -Dopensearch.version=1.1.0-SNAPSHOT
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: logs
path: |
build/testclusters/integTest-*/logs/*
build/testclusters/leaderCluster-*/logs/*
build/testclusters/followCluster-*/logs/*
- name: Create Artifact Path
run: |
pwd
mkdir -p cross-cluster-replication-artifacts
cp ./build/distributions/*.zip cross-cluster-replication-artifacts
pwd
- name: Uploads coverage
uses: codecov/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class SecurityCustomRolesIT: SecurityBase() {

try {
followerClient.updateAutoFollowPattern(connectionAlias, indexPatternName, indexPattern,
assumeRoles = UseRoles(leaderClusterRole = "leaderRoleValidPerms",followerClusterRole = "followerRoleValidPerms"),
useRoles = UseRoles(leaderClusterRole = "leaderRoleValidPerms",followerClusterRole = "followerRoleValidPerms"),
requestOptions= RequestOptions.DEFAULT.addBasicAuthHeader("testUser1","password"))

// Verify that existing index matching the pattern are replicated.
Expand Down Expand Up @@ -360,7 +360,7 @@ class SecurityCustomRolesIT: SecurityBase() {

Assertions.assertThatThrownBy {
followerClient.updateAutoFollowPattern(connectionAlias, indexPatternName, indexPattern,
assumeRoles = UseRoles(leaderClusterRole = "leaderRoleValidPerms",followerClusterRole = "followerRoleNoPerms"),
useRoles = UseRoles(leaderClusterRole = "leaderRoleValidPerms",followerClusterRole = "followerRoleNoPerms"),
requestOptions= RequestOptions.DEFAULT.addBasicAuthHeader("testUser2","password"))
}.isInstanceOf(ResponseException::class.java)
.hasMessageContaining("403 Forbidden")
Expand Down

0 comments on commit c2231a7

Please sign in to comment.