Skip to content

Commit

Permalink
Merge branch 'WORDSCLOUD_893' into 'master'
Browse files Browse the repository at this point in the history
Wordscloud 893

See merge request words-cloud/words-cloud-node!3
  • Loading branch information
dmitry-finozhenok committed Oct 7, 2019
2 parents 95e79e9 + a617b98 commit 62ff6b3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 174 deletions.
130 changes: 11 additions & 119 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,124 +1,16 @@
# project files
.vscode/*

Temp/
obj/
classes/
generated/
*.suo
bin/
*_out_*
* Out*
* out*
*.ldb
Thumbs.db
_ReSharper*/
out/
*.lic
*.user
Out/
Out*/
Data/*Out*
TestResults/
*.ide
*.vsmdi
test-results/
# node packages
package-lock.json
node_modules/
*.userprefs
packages/
Plugins/Aspose_Words_NET_for_PHP/.idea/*
Plugins/Aspose_Words_NET_for_PHP/vendor/*
Plugins/Aspose_Words_NET_for_PHP/composer.lock
*.gitattributes
*.pyc
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries

# Keystore files
*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear
*.zip
*.tar.gz
*.rar
# credentials
testConfig.json
.npmrc

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# build files
dist/*

.DS_Store
*.xcuserstate*StyleCop.Cache
*StyleCop.Cache
SDKs/NET/.vs/*
SDKs/PHP/.idea/*
SDKs/PHP/vendor/*
SDKs/PHP/testReports/*
SDKs/servercreds.json
*/testConfig.json
/dist/*
/servercreds.json
testConfig.json
/ts-node-*
reports/*
/.npmrc
# reports
reports/*
16 changes: 7 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
parameters {
string(name: 'branch', defaultValue: 'master', description: 'branch to test')
string(name: 'testServerUrl', defaultValue: 'https://auckland-words-cloud-staging.dynabic.com', description: 'server url')
}
properties([
parameters([string(defaultValue: 'master', description: 'the branch to build', name: 'branch', trim: true)])
])

def runtests(dockerImageVersion)
{
dir(dockerImageVersion){
try {
stage('checkout'){
checkout([$class: 'GitSCM', branches: [[name: '*/' + params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
checkout([$class: 'GitSCM', branches: [[name: '*/' + params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'AppKey', usernameVariable: 'AppSid')]) {
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"$testServerUrl\\"}" > testConfig.json'
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\"}" > testConfig.json'
}
}

Expand Down Expand Up @@ -56,7 +55,6 @@ def runtests(dockerImageVersion)
}
}

node('billing-qa-ubuntu-16.04.4') {
runtests("latest")
runtests("6")
node('words-linux') {
runtests("latest")
}
66 changes: 33 additions & 33 deletions JenkinsfileRelease
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
node('billing-qa-ubuntu-16.04.4') {
node('words-linux') {
try {
stage('checkout'){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'AppKey', usernameVariable: 'AppSid')]) {
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"https://auckland-words-cloud-staging.dynabic.com\\"}" > testConfig.json'
}
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])

sh "git config user.email \"jenkins.aspose@gmail.com\""
sh "git config user.name \"jenkins\""
sh "git config user.email \"jenkins.aspose@gmail.com\""
sh "git config user.name \"jenkins\""

withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', usernameVariable: 'gitUsername', passwordVariable: 'gitPass')]) {
gitRepoUrl = "https://${gitUsername}:${gitPass}@git.auckland.dynabic.com/words-cloud/words-cloud-node.git"
}
}

docker.image('node:latest').inside{
Expand Down Expand Up @@ -37,10 +38,7 @@ node('billing-qa-ubuntu-16.04.4') {
sh "git merge --no-ff --allow-unrelated-histories origin/master"
sh "git diff --name-status"
sh 'git commit -am "Merged master branch to testPackage" || exit 0'

withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
sh "git push https://WordsCloud:$gitPass@github.com/aspose-words-cloud/aspose-words-cloud-node testPackage"
}
sh "git push ${gitRepoUrl} testPackage"
}

stage('add reference to new package'){
Expand All @@ -64,9 +62,7 @@ node('billing-qa-ubuntu-16.04.4') {
sh "git ls-files --others --exclude-standard"
sh "git add -A"
sh 'git commit -am "new version of package added to repository" || exit 0'
withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
sh "git push https://WordsCloud:$gitPass@github.com/aspose-words-cloud/aspose-words-cloud-node testPackage"
}
sh "git push ${gitRepoUrl} testPackage"
}

} finally {
Expand All @@ -75,10 +71,9 @@ node('billing-qa-ubuntu-16.04.4') {
}

stage('test package'){
build job: 'words-sdk-nodejs',
build job: 'words-node-sdk',
parameters: [
string(name: 'branch', value: 'testPackage'),
string(name: 'testServerUrl', value: 'https://api.aspose.cloud')
string(name: 'branch', value: 'testPackage')
]
}

Expand All @@ -88,11 +83,18 @@ stage('wait for publish confirmation'){
}
}

node('billing-qa-ubuntu-16.04.4') {
node('words-linux') {
try {
stage('checkout again'){
checkout([$class: 'GitSCM', branches: [[name: '*/testPackage']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', url: 'https://github.com/aspose-words-cloud/aspose-words-cloud-node.git/']]])
checkout([$class: 'GitSCM', branches: [[name: '*/testPackage']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])

sh "git config user.email \"jenkins.aspose@gmail.com\""
sh "git config user.name \"jenkins\""

withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', usernameVariable: 'gitUsername', passwordVariable: 'gitPass')]) {
gitRepoUrl = "https://${gitUsername}:${gitPass}@git.auckland.dynabic.com/words-cloud/words-cloud-node.git"
}

sh "git checkout testPackage"
sh "git reset --hard origin/testPackage"
}
Expand All @@ -108,8 +110,8 @@ node('billing-qa-ubuntu-16.04.4') {
*/
'HOME=.',
]) {
withCredentials([usernamePassword(credentialsId: '19f0eab9-c600-4746-a4bd-724efd2102c8', passwordVariable: 'npmPass', usernameVariable: 'npmLogin')]) {
sh "echo //registry.npmjs.org/:_authToken=${npmPass} > .npmrc"
withCredentials([string(credentialsId: '19f0eab9-c600-4746-a4bd-724efd2102c8', variable: 'npmToken')]) {
sh "echo //registry.npmjs.org/:_authToken=${npmToken} > .npmrc"
sh "npm publish ${packageName}"
}
}
Expand All @@ -134,20 +136,18 @@ node('billing-qa-ubuntu-16.04.4') {

sh "git diff --name-status"
sh 'git commit -am "reference changed to published package" || exit 0'
withCredentials([usernamePassword(credentialsId: '9d6c4dfa-042c-4ed1-81c7-9175179dddda', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
sh "git push https://WordsCloud:$gitPass@github.com/aspose-words-cloud/aspose-words-cloud-node testPackage"
}
sh "git push ${gitRepoUrl} testPackage"
}

stage('add version tag') {
final fullVersion = packageName.substring(packageName.lastIndexOf('@') + 1, packageName.length())
final version = fullVersion.substring(0, fullVersion.lastIndexOf('.'))

sh "git tag -a ${version} -m \"version ${version}\""
sh "git push ${gitRepoUrl} ${version}"
}

} finally {
deleteDir()
}
}

stage('test published package'){
build job: 'words-sdk-nodejs',
parameters: [
string(name: 'branch', value: 'testPackage'),
string(name: 'testServerUrl', value: 'https://api.aspose.cloud')
]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asposewordscloud",
"version": "19.2.0",
"version": "19.9.0",
"description": "Aspose.Words Cloud SDK for Node.js",
"homepage": "https://products.aspose.cloud/words/cloud",
"author": {
Expand Down
8 changes: 4 additions & 4 deletions test/documentElements/commentsTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("comments", () => {
});
});

describe("putComment function", () => {
describe("insertComment function", () => {

it("should return response with code 200", () => {

Expand All @@ -108,7 +108,7 @@ describe("comments", () => {
request.folder = remotePath;

const nodeLink = new NodeLink();
nodeLink.nodeId = "0.0.3";
nodeLink.nodeId = "0.3.0.3";
const documentPosition = new DocumentPosition();
documentPosition.node = nodeLink;
documentPosition.offset = 0;
Expand All @@ -131,7 +131,7 @@ describe("comments", () => {
});
});

describe("postComment function", () => {
describe("updateComment function", () => {

it("should return response with code 200", () => {

Expand All @@ -150,7 +150,7 @@ describe("comments", () => {

request.commentIndex = 0;
const nodeLink = new NodeLink();
nodeLink.nodeId = "0.0.3";
nodeLink.nodeId = "0.3.0";
const documentPosition = new DocumentPosition();
documentPosition.node = nodeLink;
documentPosition.offset = 0;
Expand Down
16 changes: 8 additions & 8 deletions test/documentElements/rangeTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ describe("range", () => {
const request = new GetRangeTextRequest();
request.name = remoteFileName;
request.folder = remotePath;
request.rangeStartIdentifier = "id0.0";
request.rangeEndIdentifier = "id0.1";
request.rangeStartIdentifier = "id0.0.0";
request.rangeEndIdentifier = "id0.0.1";

// Act
return wordsApi.getRangeText(request)
Expand Down Expand Up @@ -75,8 +75,8 @@ describe("range", () => {
const request = new RemoveRangeRequest();
request.name = remoteFileName;
request.folder = remotePath;
request.rangeStartIdentifier = "id0.0";
request.rangeEndIdentifier = "id0.1";
request.rangeStartIdentifier = "id0.0.0";
request.rangeEndIdentifier = "id0.0.1";

// Act
return wordsApi.removeRange(request)
Expand All @@ -103,8 +103,8 @@ describe("range", () => {
const request = new ReplaceWithTextRequest();
request.name = remoteFileName;
request.folder = remotePath;
request.rangeStartIdentifier = "id0.0";
request.rangeEndIdentifier = "id0.1";
request.rangeStartIdentifier = "id0.0.0";
request.rangeEndIdentifier = "id0.0.1";
request.rangeText = new ReplaceRange({text: "Replaced header"});

// Act
Expand Down Expand Up @@ -132,8 +132,8 @@ describe("range", () => {
const request = new SaveAsRangeRequest();
request.name = remoteFileName;
request.folder = remotePath;
request.rangeStartIdentifier = "id0.0";
request.rangeEndIdentifier = "id0.1";
request.rangeStartIdentifier = "id0.0.0";
request.rangeEndIdentifier = "id0.0.1";
request.documentParameters = new RangeDocument({documentName: remotePath + "/newDoc.docx"});

// Act
Expand Down

0 comments on commit 62ff6b3

Please # to comment.