Skip to content

Demo app loggin#4849

Merged
aaltat merged 7 commits intoMarketSquare:mainfrom
aaltat:demo_app_loggin
Apr 25, 2026
Merged

Demo app loggin#4849
aaltat merged 7 commits intoMarketSquare:mainfrom
aaltat:demo_app_loggin

Conversation

@aaltat
Copy link
Copy Markdown
Member

@aaltat aaltat commented Apr 25, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 25, 2026 15:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds request logging to the dynamic test app and captures its output into per-port log files to make debugging automated test runs easier.

Changes:

  • Add morgan (and types) and bump @yao-pkg/pkg.
  • Enable HTTP request logging middleware in node/dynamic-test-app server.
  • Redirect test server stdout/stderr into atest/output/test-app/test-app-<port>.log and close logs on shutdown.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.json Adds morgan (+ types) to support request logging; bumps @yao-pkg/pkg.
package-lock.json Lockfile updates reflecting new/updated npm dependencies.
node/dynamic-test-app/src/server.ts Wires morgan into the Express app to log requests.
atest/library/common.py Redirects test server output to log files and closes them in stop_test_server.

Comment thread atest/library/common.py Outdated
Comment thread node/dynamic-test-app/src/server.ts Outdated
Comment thread atest/library/common.py Outdated
Copilot AI review requested due to automatic review settings April 25, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/on-push.yml Outdated
Comment thread .github/workflows/on-push.yml Outdated
Comment thread Browser/playwright.py
Copilot AI review requested due to automatic review settings April 25, 2026 17:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread atest/library/common.py
Comment on lines 105 to +114
if port in SERVERS:
p: Popen = SERVERS[port]
close_process_tree(p)
del SERVERS[port]
else:
logger.warn(f"Server with port {port} not found")
if port in LOG_FILES:
LOG_FILES[port].flush()
LOG_FILES[port].close()
del LOG_FILES[port]
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

In stop_test_server, if close_process_tree(p) raises (e.g., psutil AccessDenied/other unexpected errors), the corresponding log file handle in LOG_FILES will not be flushed/closed because that cleanup happens after the process shutdown block. Consider wrapping the process shutdown in a try/finally (or otherwise guaranteeing log-file cleanup) so log handles don’t leak on teardown failures.

Suggested change
if port in SERVERS:
p: Popen = SERVERS[port]
close_process_tree(p)
del SERVERS[port]
else:
logger.warn(f"Server with port {port} not found")
if port in LOG_FILES:
LOG_FILES[port].flush()
LOG_FILES[port].close()
del LOG_FILES[port]
try:
if port in SERVERS:
p: Popen = SERVERS[port]
close_process_tree(p)
del SERVERS[port]
else:
logger.warn(f"Server with port {port} not found")
finally:
if port in LOG_FILES:
LOG_FILES[port].flush()
LOG_FILES[port].close()
del LOG_FILES[port]

Copilot uses AI. Check for mistakes.
@aaltat aaltat merged commit 9db9b7b into MarketSquare:main Apr 25, 2026
66 of 69 checks passed
@aaltat aaltat deleted the demo_app_loggin branch April 25, 2026 18:39
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.

2 participants