Skip to content
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

“Test cases cannot achieve project readme functionality”Problem Solvi… #3430

Open
wants to merge 1 commit into
base: 2022.x
Choose a base branch
from

Conversation

MBAI-Bill
Copy link

“Test cases cannot achieve project readme functionality”Problem Solving,Reason: When the file contents of the nacos file are being initialized, it has not been executed correctly and the configuration file is incorrect. Solution: It was discovered that only data source-related configurations exist in the file in nacos. Then I put other configuration content in the front position and re-executed the script. It was found that the content was successfully loaded. The consumer method name in the previously configured "bindings" was inconsistent with the actual code, and there was no configuration for"function.Fixes gh-3427

…ng,Reason: When the file contents of the nacos file are being initialized, it has not been executed correctly and the configuration file is incorrect. Solution: It was discovered that only data source-related configurations exist in the file in nacos. Then I put other configuration content in the front position and re-executed the script. It was found that the content was successfully loaded. The consumer method name in the previously configured "bindings" was inconsistent with the actual code, and there was no configuration for"function.Fixes alibabagh-3427
@CLAassistant
Copy link

CLAassistant commented Aug 21, 2023

CLA assistant check
All committers have signed the CLA.

pullBatchSize: 4
datasource:
url: jdbc:mysql://integrated-mysql:3306/integrated_praise?useSSL=false&characterEncoding=utf8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to keep as few changes as possible, this part seems unnecessary to modify.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the change should be necessary, because the content of the Nacos configuration file after initialization was inconsistent with the content of the configuration file when it was not changed before. However, once the position is replaced, the content will be consistent after execution. I don't know why this is the case, but it can solve the problem. You can try it out

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Aug 22, 2023

Hello, I have some questions. As you described, I changed the configuration file to the configuration you provided, and then ran the project for testing. The result I got is still the same. Is there any other steps required?

Also, I can make sure my example environment is fine

url: http://integrated-frontend:8080/sentinel,

Response

[2023-8-22 18:40:56] 点赞前的点赞数: 0

[2023-8-22 18:40:56] 2023-8-22 18:40:56: true

[2023-8-22 18:40:56] 2023-8-22 18:40:56: true

[2023-8-22 18:40:56] 2023-8-22 18:40:56: true

[2023-8-22 18:40:56] 2023-8-22 18:40:56: true

[2023-8-22 18:40:56] 2023-8-22 18:40:56: true

[2023-8-22 18:40:56]: 请求失败,接口被限流

[2023-8-22 18:40:56]: 请求失败,接口被限流

[2023-8-22 18:40:56]: 请求失败,接口被限流

[2023-8-22 18:40:56]: 请求失败,接口被限流

[2023-8-22 18:40:56]: 请求失败,接口被限流

[2023-8-22 18:40:57] 点赞后的点赞数: 0

Configuration files

spring:
  cloud:
    stream:
      function:
        definition: consumer;
      bindings:
        consumer-in-0:
          destination: PRAISE-TOPIC-01
          content-type: application/json
          group: praise-consumer-group-PRAISE-TOPIC-01
      rocketmq:
        binder:
          name-server: rocketmq:9876
        bindings:
          consumer-in-0:
            consumer:
              pullInterval: 4000
              pullBatchSize: 4
  datasource:
    url: jdbc:mysql://integrated-mysql:3306/integrated_praise?useSSL=false

@China-MBAI

@MBAI-Bill
Copy link
Author

MBAI-Bill commented Aug 23, 2023

You need to check if the configuration file on Nacos is consistent with my modifications. If it is inconsistent, please replace it with my configuration in the "integrated-consumer.yaml" file and then execute the "sh nacos-config-quick.sh" command in the "integrated-example/config-init/scripts/nacos-config-quick.sh" folder. After the command is executed, the configuration on Nacos will change, and then restart the project.After modifying the configuration file, you can also follow the instructions document "local-deployment.md" to execute step by step again

@yuluo-yx
Copy link
Collaborator

You need to check if the configuration file on Nacos is consistent with my modifications. If it is inconsistent, please replace it with my configuration in the "integrated-consumer.yaml" file and then execute the "sh nacos-config-quick.sh" command in the "integrated-example/config-init/scripts/nacos-config-quick.sh" folder. After the command is executed, the configuration on Nacos will change, and then restart the project.After modifying the configuration file, you can also follow the instructions document "local-deployment.md" to execute step by step again

of course, I made sure my config file got update and I restarted project.
The configuration in my nacos is as shown in the figure above.

@MBAI-Bill
Copy link
Author

您需要检查Nacos上的配置文件是否与我的修改一致。如果不一致,请将“integrated-consumer.yaml”文件中的配置替换为我的配置,然后在“integrated-example/config-init/scripts/nacos”中执行“sh nacos-config-quick.sh”命令-config-quick.sh”文件夹。命令执行后,Nacos上的配置会发生变化,然后重启项目。修改配置文件后,也可以按照说明文档“local-deployment.md”重新一步步执行

当然,我确保我的配置文件已更新并重新启动了项目。 我的nacos中的配置如上图所示。

@MBAI-Bill MBAI-Bill closed this Aug 23, 2023
@MBAI-Bill MBAI-Bill reopened this Aug 23, 2023
@MBAI-Bill
Copy link
Author

MBAI-Bill commented Aug 23, 2023

您需要检查Nacos上的配置文件是否与我的修改一致。如果不一致,请将“integrated-consumer.yaml”文件中的配置替换为我的配置,然后在“integrated-example/config-init/scripts/nacos”中执行“sh nacos-config-quick.sh”命令-config-quick.sh”文件夹。命令执行后,Nacos上的配置会发生变化,然后重启项目。修改配置文件后,也可以按照说明文档“local-deployment.md”重新一步步执行

当然,我确保我的配置文件已更新并重新启动了项目。 我的nacos中的配置如上图所示。

Have you ever executed this command:sh nacos-config-quick.sh

@yuluo-yx
Copy link
Collaborator

您需要检查Nacos上的配置文件是否与我的修改一致。如果不一致,请将“integrated-consumer.yaml”文件中的配置替换为我的配置,然后在“integrated-example/config-init/scripts/nacos”中执行“sh nacos-config-quick.sh”命令-config-quick.sh”文件夹。命令执行后,Nacos上的配置会发生变化,然后重启项目。修改配置文件后,也可以按照说明文档“local-deployment.md”重新一步步执行

当然,我确保我的配置文件已更新并重新启动了项目。 我的nacos中的配置如上图所示。

Have you ever executed this command:sh nacos-config-quick.sh

yeay, I will try to do again in later.

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Aug 23, 2023

my config file:

nacos:

test:

Can you show your result of your run test?
@China-MBAI

@MBAI-Bill
Copy link
Author

my config file:

nacos:

test:

Can you show your result of your run test? @China-MBAI

integrated-consumer.yaml:
image
application:
image

nacos:
image
result:
image

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Aug 24, 2023

okay, got it. I tested locally and passed.

LGTM! @China-MBAI

@ruansheng8 ruansheng8 self-requested a review August 24, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test cases cannot achieve project readme functionality
4 participants