Skip to content

Commit

Permalink
Merge pull request #776 from naver/release/3.5.4
Browse files Browse the repository at this point in the history
Release 3.5.4
  • Loading branch information
imbyungjun authored Mar 19, 2021
2 parents 3b4b707 + fe02e7e commit 2f706e8
Show file tree
Hide file tree
Showing 158 changed files with 9,152 additions and 281 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a bug & errors report to help us improve
title: ''
labels: ''
assignees: ''

---

### 1. Describe the bug 🐞
:exclamation: DO NOT ASK QUESTION HERE PLEASE USE [DISCUSSION](https://github.com/naver/ngrinder/discussions) INSTEAD.

A clear and concise description of what the bug is.

### 2. Reproduction steps
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### 3. Environment
- Controller
- OS:
- Browser:
- JDK version:
- Controller version:
- Agent
- OS:
- JDK version:
- Agent version:

### 4. Screenshots
If necessary, add screenshots to help explain your problem.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: nGrinder community forum
url: https://github.com/naver/ngrinder/discussions
about: Please ask and answer questions here.
27 changes: 27 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ The following components are included without modification:
Information: http://logging.apache.org/
License: http://www.apache.org/licenses/LICENSE-2.0

- httpcomponents-client -
Information: https://github.com/apache/httpcomponents-client
License: http://www.apache.org/licenses/LICENSE-2.0

The following components are included with modification:

- cpptasks -
Expand Down Expand Up @@ -554,3 +558,26 @@ See the License for the specific language governing permissions and
limitations under the License.

=====

apache/httpcomponents-client
https://github.com/apache/httpcomponents-client

Apache HttpComponents Client
Copyright 1999-2021 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=====
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* nGrinder 3.5.3 has been released. See https://github.com/naver/ngrinder/releases
* Please post questions in [Discussions](https://github.com/naver/ngrinder/discussions) not Issues.
* nGrinder 3.5.4 has been released. See https://github.com/naver/ngrinder/releases

nGrinder
========
Expand Down
28 changes: 28 additions & 0 deletions RELEASE-NOTE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
3.5.4 (2021.03.19)
==================
- Changes
- Release new experimental HttpClient based on apache httpcomponents-core
* Support modern HTTP specification
* Provide easy-to-use APIs
* See [new nGrinder HTTP client guide](https://github.com/naver/ngrinder/wiki/The-New-nGrinder-HTTP-Client)
- Use controller DNS instead of IP to support agent-controller reconnection in cloud env
- Support script template customization
* Each ngrinder admin can deploy customized script template under ${NGRINDER_HOME}/script_template
- Provide the connection reset option in test configuration page
* If you turn it on, it tries to reuse connection as much as possible.
- Bump Jython standard up to 2.7.2
- Bump internal used Junit up to 4.13.1
* nGrinder no longer depends on specific version of junit for performance test
- Notice
- If you have a trouble with updating controller from ngrinder 3.4.X to a newer version. Please refer to [How to update ngrinder controller](https://github.com/naver/ngrinder/wiki/How-to-update-ngrinder-controller)
- Bug fix
- #706 Cancel progressing state test when starting controller
- #714 Fix validation error when using AppClassLoader in over JDK9
- #716 Fix script validation error in windows
- #731 Fix not working remember-me
- #739 Fix easy clustering
- #745 Make compatibility with IE11
- #748 Make grinder utils work on Jython performance test
- #773 Fix cannot search user with two characters
- #774, #779 Fix duplicated running test on one user

3.5.3 (2020.11.27)
==================
- Changes
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ allprojects {
apply plugin: "idea"

group = "org.ngrinder"
version = "3.5.3"
version = "3.5.4"

idea {
module {
Expand Down Expand Up @@ -35,6 +35,7 @@ subprojects {

ext {
profile = project.hasProperty("profile") ? profile : "production"
esCheckModuleVersion = project.hasProperty("esCheckModuleVersion") ? esCheckModuleVersion : ""
slf4j_version = "1.7.28"
spring_security_version = "5.3.4.RELEASE"
spring_boot_version = "2.3.3.RELEASE"
Expand All @@ -44,7 +45,8 @@ subprojects {
mockito_version = "2.23.4"
handlebars_version = "4.0.5"
jackson_version = "2.11.2"
groovy_version = "3.0.5"
groovy_version = project.property("groovy.version")
junit_version = project.property("junit.version")
}

repositories {
Expand Down
2 changes: 2 additions & 0 deletions docker/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ RUN apk update; apk add curl bash


# Set up environment variables
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
ENV LANG=en_US.UTF-8
ENV BASE_DIR=/opt \
NGRINDER_AGENT_BASE=/opt/ngrinder-agent \
NGRINDER_AGENT_HOME=/opt/ngrinder-agent/.ngrinder-agent
Expand Down
2 changes: 2 additions & 0 deletions docker/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ RUN mkdir -p /usr/share/gradle \
&& rm -f /tmp/gradle.zip

# Set up environment variables
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
ENV LANG=en_US.UTF-8
ENV BASE_DIR=/opt \
NGRINDER_HOME=/opt/ngrinder-controller \
MAVEN_HOME=/usr/share/maven \
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.daemon=true
jna.version=5.6.0
groovy.version=3.0.5
junit.version=4.13.1
15 changes: 8 additions & 7 deletions ngrinder-controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ dependencies {
compile (group: "rome", name: "rome", version: "1.0")
compile (group: "com.ibm.icu", name: "icu4j", version: "4.6")
compile (group: "sonia.svnkit", name: "svnkit-dav", version: svnkit_version)
compile (group: "sonia.svnkit", name: "svnkit", version: svnkit_version)
compile (group: "sonia.svnkit", name: "svnkit", version: svnkit_version) {
exclude (module: "platform")
}
compile (group: "javax.servlet.jsp", name: "jsp-api", version: "2.1")
compile (group: "org.python", name: "jython-standalone", version: "2.5.3")
compile (group: "com.google.guava", name: "guava", version: "20.0")
compile (group: "org.springframework.security", name: "spring-security-taglibs", version: spring_security_version)
compile (group: "org.liquibase", name: "liquibase-core", version: "3.5.3")
Expand All @@ -54,7 +55,6 @@ dependencies {
compile (group: "com.h2database", name: "h2", version: "1.4.197")
compile (group: "commons-fileupload", name: "commons-fileupload", version: "1.3.1")
compile (group: "commons-dbcp", name: "commons-dbcp", version: "1.4")
compile (group: "cglib", name: "cglib", version: "2.2.2")
compile (group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: jackson_version)
compile (group: "com.fasterxml.jackson.core", name: "jackson-databind", version: jackson_version)
compile (group: "jaxen", name: "jaxen", version: "1.1.4")
Expand All @@ -75,10 +75,9 @@ dependencies {

providedRuntime (group: "org.springframework.boot", name: "spring-boot-starter-tomcat", version: spring_boot_version)

testCompile (group: "junit", name: "junit", version: "4.13")
testCompile (group: "junit", name: "junit", version: junit_version)
testCompile (group: "org.easytesting", name: "fest-assert", version: "1.4")
testCompile (group: "org.springframework.boot", name: "spring-boot-starter-test", version: spring_boot_version)

testCompileOnly (group: "org.projectlombok", name: "lombok", version: "1.18.8")
testAnnotationProcessor (group: "org.projectlombok", name: "lombok", version: "1.18.8")
}
Expand All @@ -104,7 +103,8 @@ task convert_cr_lf {

processResources {
filesMatching("ngrinder-sh/agent/run_agent_internal.*") {
expand(["ngrinder_core": String.format("lib/ngrinder-core-%s.jar", project.version)])
expand(["ngrinder_core": String.format("lib/ngrinder-core-%s.jar", project.version),
"ngrinder_runtime": String.format("lib/ngrinder-runime-%s.jar", project.version)])
}
}

Expand All @@ -114,4 +114,5 @@ test {

tasks.bootWar.dependsOn convert_cr_lf

tasks.processResources.dependsOn tasks.getByPath(":ngrinder-frontend:webpack")
tasks.processResources.finalizedBy tasks.getByPath(":ngrinder-frontend:webpack")
tasks.processResources.finalizedBy tasks.getByPath(":ngrinder-frontend:checkES5")
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.net.URLClassLoader;

import lombok.RequiredArgsConstructor;

Expand Down Expand Up @@ -67,8 +66,8 @@ public void download(@PathVariable String fileName, HttpServletResponse response
@GetMapping("")
public String download(ModelMap model) {
try {
final File monitorPackage = agentPackageService.createPackage(monitorPackageHandler, (URLClassLoader) getClass().getClassLoader(),
"", null, config.getMonitorPort(), "");
final File monitorPackage = agentPackageService.createPackage(monitorPackageHandler, "",
null, config.getMonitorPort(), "");
model.clear();
return "redirect:/monitor/download/" + monitorPackage.getName();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

import java.io.*;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Set;

import lombok.RequiredArgsConstructor;

import static net.grinder.util.AbstractGrinderClassPathProcessor.getClassPaths;
import static org.apache.commons.lang.StringUtils.isNotEmpty;
import static org.ngrinder.common.util.EncodingUtils.decodePathWithUTF8;
import static org.ngrinder.common.util.StringUtils.replaceLast;
Expand All @@ -39,15 +39,15 @@ public class AgentPackageService {
*
* @return File package.
*/
public File createPackage(PackageHandler packageHandler, URLClassLoader classLoader, String regionName, String connectionIP, int port, String owner) {
public File createPackage(PackageHandler packageHandler, String regionName, String connectionIP, int port, String owner) {
synchronized (AgentPackageService.class) {
File packageFile = packageHandler.getPackageFile(regionName, connectionIP, owner, false);
if (packageFile.exists()) {
return packageFile;
}
FileUtils.deleteQuietly(packageFile);
try (TarArchiveOutputStream tarOutputStream = createTarArchiveStream(packageFile)) {
addDependentLibToTarStream(packageHandler, tarOutputStream, classLoader);
addDependentLibToTarStream(packageHandler, tarOutputStream);
if (!(packageHandler instanceof AgentPackageHandler) || isNotEmpty(connectionIP)) {
packageHandler.addConfigToPackage(tarOutputStream, packageHandler.getConfigParam(regionName, connectionIP, port, owner));
}
Expand Down Expand Up @@ -77,19 +77,16 @@ public File createAgentPackage() {
*/
public File createAgentPackage(String region, String connectionIP, int port, String owner) {
synchronized (AgentPackageService.class) {
return createPackage(agentPackageHandler, (URLClassLoader) getClass().getClassLoader(), region, connectionIP, port, owner);
return createPackage(agentPackageHandler, region, connectionIP, port, owner);
}
}

private void addDependentLibToTarStream(PackageHandler packageHandler, TarArchiveOutputStream tarOutputStream, URLClassLoader classLoader) throws IOException {
if (classLoader == null) {
classLoader = (URLClassLoader) getClass().getClassLoader();
}
private void addDependentLibToTarStream(PackageHandler packageHandler, TarArchiveOutputStream tarOutputStream) throws IOException {
packageHandler.addBaseFolderToPackage(tarOutputStream);
Set<String> libs = packageHandler.getPackageDependentLibs(classLoader);
Set<String> libs = packageHandler.getPackageDependentLibs();
packageHandler.copyShellFile(tarOutputStream);

for (URL eachUrl : classLoader.getURLs()) {
for (URL eachUrl : getClassPaths(getClass().getClassLoader())) {
File eachClassPath = new File(decodePathWithUTF8(eachUrl.getFile()));
if (!isJar(eachClassPath)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
public class Home {

// HOME_PATH
public static final String PATH_SCRIPT_TEMPLATE_DIRECTORY = "/script_template";

private static final String PATH_PLUGIN = "plugins";
private static final String PATH_SCRIPT = "script";
private static final String PATH_USER_REPO = "repos";
Expand Down Expand Up @@ -269,6 +271,10 @@ public File getDistributedFolderName(String id) {
return new File(getPerfTestDirectory(), folderName);
}

public File getScriptTemplateDirectory() {
return new File(directory, PATH_SCRIPT_TEMPLATE_DIRECTORY);
}

/**
* Get the root directory for given {@link PerfTest} id.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@
package org.ngrinder.common.util;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import static org.apache.commons.io.IOUtils.copy;
import static org.apache.commons.io.FileUtils.*;

/**
* Convenient File utilities.
*
* @since 3.1
*/
@Slf4j
public abstract class FileUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(FileUtils.class);

/**
* Copy the given resource to the given file.
Expand All @@ -40,11 +39,15 @@ public abstract class FileUtils {
* @since 3.2
*/
public static void copyResourceToFile(String resourcePath, File file) {
try (InputStream io = new ClassPathResource(resourcePath).getInputStream();
FileOutputStream fos = new FileOutputStream(file)) {
copy(io, fos);
copyResourceToFile(new ClassPathResource(resourcePath), file);
}

public static void copyResourceToFile(Resource resource, File file) {
try (InputStream io = resource.getInputStream()) {
copyToFile(io, file);
} catch (IOException e) {
LOGGER.error("error while writing {}", resourcePath, e);
log.error("error while writing {}", resource.getFilename(), e);
}
}

}
Loading

0 comments on commit 2f706e8

Please sign in to comment.