Skip to content

[nodejs] enable fastify cookies tests #4803

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 6 commits into
base: main
Choose a base branch
from

Conversation

IlyasShabi
Copy link
Contributor

@IlyasShabi IlyasShabi commented Jun 19, 2025

Motivation

Enable fastify cookies tests

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@IlyasShabi IlyasShabi force-pushed the ishabi/fastify-cookies branch from bf8ef18 to 4fe533b Compare June 19, 2025 10:01
@IlyasShabi IlyasShabi force-pushed the ishabi/fastify-cookies branch from 4fe533b to e3eb64f Compare June 19, 2025 12:35
@IlyasShabi IlyasShabi changed the title [nodejs@ishabi/fastify-cookies] enable fastify cookies tests [nodejs] enable fastify cookies tests Jun 25, 2025
@IlyasShabi IlyasShabi marked this pull request as ready for review June 26, 2025 07:31
@IlyasShabi IlyasShabi requested review from a team as code owners June 26, 2025 07:31
@@ -192,6 +187,7 @@ def setup_session_non_blocking(self):
self.cookies = self.r_create_session.cookies
self.r_user = weblog.get("/user_login_success_event", cookies=self.cookies)

@missing_feature(context.weblog_variant == "fastify", reason="session fingerprint not supported yet")
Copy link
Member

Choose a reason for hiding this comment

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

the whole class should fail not jusr this test no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test_session_blocking is passing 🤔

Copy link
Member

Choose a reason for hiding this comment

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

did you add a session middleware to fastify weblog ? if not, it's a problem in the test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

even then, it doesn't make sense that the "non_blocking" test is skipped, "but the "blocking" one passes. If a feature works with blocking, it should work without blocking

@@ -192,6 +187,7 @@ def setup_session_non_blocking(self):
self.cookies = self.r_create_session.cookies
self.r_user = weblog.get("/user_login_success_event", cookies=self.cookies)

@missing_feature(context.weblog_variant == "fastify", reason="session fingerprint not supported yet")
def test_session_non_blocking(self):
assert self.r_create_session.status_code == 200
Copy link
Member

Choose a reason for hiding this comment

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

try without this line see if the test pass ?

Suggested change
assert self.r_create_session.status_code == 200
# assert self.r_create_session.status_code == 200

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's working yes

Copy link
Member

Choose a reason for hiding this comment

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

well, the session fingerprinting blocking test doesn't have this check, so why would the nonblocking one have it. Either they should both have it, or neither. I think it's safe to remove ?

Copy link
Member

Choose a reason for hiding this comment

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

It's a test change, so talk about it with other lib engs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, I fixed the test by modifying the endpoint behaviour and I added a todo comment.
I think this should not be a blocker for this PR since we still miss session management with fastify, however we can ask @Anilm3 about this since he implemented this test https://github.com/DataDog/system-tests/pull/4382/files#diff-c4d709ffdb6e4493d3ee3f20c624c1e5ec0fa3ee4ad6ad6bb435e3c0ad56e1d1R100

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