Skip to content

3753 update cos credentials #22

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

Merged
merged 3 commits into from
Mar 23, 2023
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ hs_err_pid*
/**/dependency-reduced-pom.xml

# files produced by "npm install" commands during build
package.json
package-lock.json
node_modules/
node_modules/
.vscode/
18 changes: 7 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
language: java
dist: bionic
group: bionic

jdk:
- openjdk8
- openjdk11

notifications:
email: true
Expand Down Expand Up @@ -35,7 +35,7 @@ before_install:
jobs:
include:
- stage: Build-Test
jdk: openjdk8
jdk: openjdk11
install: true
script:
- build/setMavenVersion.sh
Expand All @@ -44,19 +44,15 @@ jobs:
- stage: Semantic-Release
install:
- nvm install 14
- npm install -g [email protected]
- npm install @semantic-release/changelog
- npm install @semantic-release/exec
- npm install @semantic-release/git
- npm install @semantic-release/github
- npm install
- pip install --user bump2version
script:
- npx semantic-release
- npm run semantic-release
after_success:
- echo "Semantic release has successfully created a new tagged-release"

- stage: Publish-Release
jdk: openjdk8
jdk: openjdk11
name: Publish-Javadoc
install: true
script:
Expand All @@ -66,7 +62,7 @@ jobs:
after_success:
- echo "Javadocs successfully published to gh-pages!"

- jdk: openjdk8
- jdk: openjdk11
name: Publish-To-Maven-Central
install: true
script:
Expand Down
3 changes: 3 additions & 0 deletions HOW_TO_TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
1. You must create 2 instances of Analytics Engine service - Serverless plan.
1. Provide instance home details in the 1st instance.
1. Don't provide instance home details in the 2nd instance.
1. You must have two set of HMAC Access Key and HMAC secret key - Credentials must have write access to the object storage used as instance home.

## Integration Tests

Expand All @@ -15,6 +16,8 @@
1. `IBM_ANALYTICS_ENGINE_API_INSTANCE_GUID_WO_INSTANCE_HOME`=`<Id of your Analytics Engine Service plan instance created without instance home>`
1. `IBM_ANALYTICS_ENGINE_API_HMAC_ACCESS_KEY`=`<HMAC access key of the cos instance to be used as instance home>`
1. `IBM_ANALYTICS_ENGINE_API_HMAC_SECRET_KEY`=`<HMAC secret key of the cos instance to be used as instance home>`
1. `IBM_ANALYTICS_ENGINE_API_ALTERNATE_HMAC_ACCESS_KEY`=`<HMAC access key of the cos instance to be used as instance home>`
1. `IBM_ANALYTICS_ENGINE_API_ALTERNATE_HMAC_SECRET_KEY`=`<HMAC secret key of the cos instance to be used as instance home>`
1. Go to Project's root directory `ibm-iae-java-sdk/` directory.
1. Run `mvn test -Dsurefire.failIfNoSpecifiedTests=false -Dtest=IbmAnalyticsEngineApiIT`

Expand Down
9 changes: 2 additions & 7 deletions modules/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@

import java.io.File;

import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.testng.PowerMockTestCase;

import org.testng.SkipException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
Expand All @@ -28,9 +25,8 @@
/**
* This class provides common functionality used by integration tests.
*/
@PrepareForTest({ EnvironmentUtils.class })
@PowerMockIgnore({"javax.net.ssl.*", "okhttp3.*"})
public abstract class SdkIntegrationTestBase extends PowerMockTestCase {

public abstract class SdkIntegrationTestBase {

// Default behavior is to skip tests, unless we have a valid config file.
protected boolean skipTests = true;
Expand Down Expand Up @@ -66,8 +62,7 @@ protected boolean skipTests() {
@BeforeClass
public void setUpConfig() throws Exception, InterruptedException {
// Allow the java core to "see" the config file if/when the testcase asks the core to load it.
PowerMockito.spy(EnvironmentUtils.class);
PowerMockito.when(EnvironmentUtils.getenv("IBM_CREDENTIALS_FILE")).thenReturn(getConfigFilename());


// Next, determine if the tests within the subclass should be skipped,
// based on whether or not the config file exists.
Expand All @@ -78,6 +73,10 @@ public void setUpConfig() throws Exception, InterruptedException {
String.format(">>> Configuration file %s not found, skipping tests.", configFile.getCanonicalPath()));
} else {
skipTests = false;


// Set the system property to point to the config file.
System.setProperty("IBM_CREDENTIALS_FILE", getConfigFilename());
}
}

Expand Down
4 changes: 4 additions & 0 deletions modules/coverage-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<artifactId>ibm-analytics-engine-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 4 additions & 0 deletions modules/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Loading