Skip to content

feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test #2319

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

VinciWu557
Copy link
Contributor

@VinciWu557 VinciWu557 commented May 25, 2025

Ⅰ. Describe what this PR did

新增 dify ai-proxy 插件 e2e 测试

Ⅱ. Does this pull request fix one issue?

fixes #1724

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

由于 plugins/wasm-go/extensions/ai-proxy/provider/dify.go 中的 responseDify2OpenAI 和 streamResponseDify2OpenAI 方法中对于 Created 字段的处理不合理,没有使用 difyResponse 中的 CreatedAt 字段,而是使用当前时间戳,导致测试时无法获取到 llm-mock-server 返回的 mock 值。
因此需要对 plugins/wasm-go/extensions/ai-proxy/provider/dify.go 进行相应改动。


Ⅰ. Describe what this PR did

Added the new diify ai-proxy plug-in e2e test

Ⅱ. Does this pull request fix one issue?

fixes #1724

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

V. Special notes for reviews

Because the processing of Created fields in responseDify2OpenAI and streamResponseDify2OpenAI methods in plugins/wasm-go/extensions/ai-proxy/provider/dify.go is not used to use the CreatedAt field in diifyResponse, but the current timestamp is used, resulting in the mock value returned by llm-mock-server during testing.
Therefore, it is necessary to make corresponding changes to plugins/wasm-go/extensions/ai-proxy/provider/dify.go.

@github-actions github-actions bot changed the title feat: support dify ai-proxy e2e test feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test May 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.06%. Comparing base (ef31e09) to head (5de5224).
Report is 526 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2319       +/-   ##
===========================================
+ Coverage   35.91%   46.06%   +10.15%     
===========================================
  Files          69       81       +12     
  Lines       11576    13010     +1434     
===========================================
+ Hits         4157     5993     +1836     
+ Misses       7104     6671      -433     
- Partials      315      346       +31     

see 78 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VinciWu557 VinciWu557 changed the title feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test feat: support dify ai-proxy e2e test May 25, 2025
@github-actions github-actions bot changed the title feat: support dify ai-proxy e2e test feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test May 25, 2025
@VinciWu557 VinciWu557 changed the title feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test feat: support dify ai-proxy e2e test May 26, 2025
@github-actions github-actions bot changed the title feat: support dify ai-proxy e2e test feat: support dify ai-proxy e2e test || feat: support diify ai-proxy e2e test May 26, 2025
@hanxiantao
Copy link
Collaborator

hanxiantao commented May 26, 2025

@VinciWu557 check-license这一步好像报错了
image


@VinciWu557 Check-license seems to have reported an error
image

@VinciWu557
Copy link
Contributor Author

VinciWu557 commented May 26, 2025

@VinciWu557 check-license这一步好像报错了 image

@VinciWu557 Check-license seems to have reported an error image

很奇怪,我这边应该没有提交 .tgitconfig 这个文件?

Run apache/skywalking-eyes/header@25edfc2fd8d52fb266653fb5f6c42da633d85c07
/usr/bin/docker run --name ba92419c1[7](https://github.com/alibaba/higress/actions/runs/15245241214/job/42870898590#step:5:8)e740fc6431c89e51d1836a5ba59_c787f6 --label 0ba924 --workdir /github/workspace --rm -e "INPUT_LOG" -e "INPUT_CONFIG" -e "INPUT_MODE" -e "INPUT_TOKEN" -e "GITHUB_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/higress/higress":"/github/workspace" 0ba924:19c17e740fc6431c89e51d1836a5ba59  "-v" "info" "-c" ".licenserc.yaml" "header" "check"
INFO Loading configuration from file: .licenserc.yaml 
INFO Totally checked 1697 files, valid: 461, invalid: 1, ignored: 1235, fixed: 0 
ERROR the following files don't have a valid license header: 
.tgitconfig 
ERROR one or more files does not have a valid license header

@hanxiantao
Copy link
Collaborator

hanxiantao commented May 27, 2025

@VinciWu557
master 分支已经移除 .tgitconfig 了,我更新了分支现在应该好了

image

这里包的顺序不对,如果是 goland 需要设置下 import 规范,参考:https://blog.csdn.net/sinat_24092079/article/details/120770592

其他没什么问题了


@VinciWu557
The master branch has been removed .tgitconfig and I updated the branch and it should be fine now

image

The order of packages here is wrong. If it is goland, you need to set the import specification. Refer to: https://blog.csdn.net/sinat_24092079/article/details/120770592

Nothing else is wrong

@hanxiantao hanxiantao self-requested a review May 27, 2025 06:40
@hanxiantao
Copy link
Collaborator

hanxiantao commented May 28, 2025

好像插件的 e2e 测试现在都跳过了,我这边找时间看下了
031e1ec48a3918591f9f4d130de9843


It seems that the plug-in's e2e test has been skipped now, so I've looked for time here.
031e1ec48a3918591f9f4d130de9843

@VinciWu557
Copy link
Contributor Author

好像插件的 e2e 测试现在都跳过了,我这边找时间看下了 031e1ec48a3918591f9f4d130de9843

It seems that the plug-in's e2e test has been skipped now, so I've looked for time here. 031e1ec48a3918591f9f4d130de9843

怀疑是 Github Workflow 有问题?我看其他的 pr 也有这个现象。
image
https://github.com/alibaba/higress/actions/runs/15129356702/job/42527479914?pr=2269

@hanxiantao
Copy link
Collaborator

https://github.com/alibaba/higress/actions/runs/15268013880/job/42937123237?pr=2319 这里有跑对应 e2e 测试的,@cr7258 找时间帮忙 review 下吧

Copy link
Collaborator

@cr7258 cr7258 left a comment

Choose a reason for hiding this comment

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

LGTM 🐉

Copy link
Collaborator

@CH3CHO CH3CHO left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Implement dify LLM mock server & e2e test case
5 participants