Skip to content

Removed test code #244

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

Merged
merged 1 commit into from
Oct 14, 2015
Merged

Removed test code #244

merged 1 commit into from
Oct 14, 2015

Conversation

Nyholm
Copy link
Contributor

@Nyholm Nyholm commented Aug 30, 2015

No description provided.

@dbu
Copy link
Contributor

dbu commented Aug 30, 2015

the tests fail. why do you want to remove this? any idea how to keep the tests happy?

@Nyholm
Copy link
Contributor Author

Nyholm commented Aug 30, 2015

When I copy the contents of the file to my varnish configuration, varnish starts to complain on that line.
I thought these files where just to make it easier to configure your varnish installation. I did not know they were used in integration testing.

@dbu
Copy link
Contributor

dbu commented Aug 30, 2015 via email

@dbu dbu added this to the 2.0 milestone Aug 30, 2015
@ddeboer
Copy link
Member

ddeboer commented Aug 30, 2015

I suggest we move set req.url = "/_fos_user_context_hash"; to a separate VCL, in a user_context_hash_url sub . We can then:

  • suggest users include that VCL if they want to use the default hash URL (/_fos_user_context_hash)
  • with the option of implementing the sub themselves if they want a custom URL
  • use our current user_context_hash_url only in our tests, which we then no longer include from fos_user_context.vcl (but in Functional/Fixtures/.../fox.vcl instead): I agree with @Nyholm that by default, our testing could should not be included.

@dbu
Copy link
Contributor

dbu commented Aug 30, 2015 via email

@Nyholm Nyholm force-pushed the debug_code branch 2 times, most recently from d15db53 to ef497f0 Compare August 30, 2015 22:20
@Nyholm
Copy link
Contributor Author

Nyholm commented Aug 30, 2015

Thank you both for input.
I've updated according to @ddeboer suggestions. I've aslo updated the docs.

@dbu
Copy link
Contributor

dbu commented Aug 31, 2015

i think the doc should mention that you can change the lookup url by including your own vcl file

@dbu
Copy link
Contributor

dbu commented Aug 31, 2015

apart from that 👍

@Nyholm
Copy link
Contributor Author

Nyholm commented Aug 31, 2015

Yes, It should be mentioned in the documentation. I'll add something in a minute.

I would like to share how I use these VCLs. I use them as reference configuration. I copied everything to one big VCL and made some minor adjustments. I keep them outside of the git repo. My point is: If I'm going to change the URL, I'm more likely to actually edit fos_user_context_url.vcl than create my own and make sure to include my new VCL instead of the provided one.
Some other developer using the VCLs might remove the call user_context_hash_url; and replace it with set req.url = "/_fos_user_context_hash"; because it simpler and they don't care about the tests.

@@ -202,7 +202,10 @@ User Context

Feature: :doc:`user context hashing <user-context>`

Subroutines are provided in ``resources/config/varnish-[version]/fos_user_context.vcl``.
Subroutines are provided in ``resources/config/varnish-[version]/fos_user_context.vcl`` and ``resources/config/varnish-[version]/fos_user_context_url.vcl``. The default lookup URL is `/_fos_user_context_hash`. You
may change it by implementing your own ``user_context_hash_url`` subroutine.
Copy link
Contributor

Choose a reason for hiding this comment

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

lets rephrase this to say that fos_user_context.vcl needs the user_context_hash_url subroutine that sets the url to the request lookup url. The default URL is /_fos_user_context_hash and you can simply include ..._url.vcl in your configuration to provide this. If you need a different URL, include a custom file.

@dbu
Copy link
Contributor

dbu commented Oct 14, 2015

sorry, missed this update. i proposed an improvement on the documentation, otherwise i think this is ready to merge and indeed more clean than the previous solution.

re: your usage: our idea is that for version 2.0 you can use the vcl as-is and just add your own things. this would make maintenance easier. but of course people are free to follow other approaches. everything in one file seems hard on readability and updateability to me though - and performance wise should not matter as the configuration is compiled at startup anyways.

@dbu
Copy link
Contributor

dbu commented Oct 14, 2015

oh, and could you squash the commits please?

@Nyholm
Copy link
Contributor Author

Nyholm commented Oct 14, 2015

Sorry for not making a comment after updating last time. I've updated the PR now. What do you think?

dbu added a commit that referenced this pull request Oct 14, 2015
@dbu dbu merged commit 143f15a into FriendsOfSymfony:master Oct 14, 2015
@dbu
Copy link
Contributor

dbu commented Oct 14, 2015

thanks a lot!

the test failure is with hhvm, and noted in #245 and has nothing to do with your changes.

@Nyholm
Copy link
Contributor Author

Nyholm commented Oct 14, 2015

Thank you for reviewing and merging this.

@Nyholm Nyholm deleted the debug_code branch October 14, 2015 11:30
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.

3 participants