Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[LDAP] Add ldap tests to github CI#39030
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wouterj commentedNov 7, 2020
Thank you for starting this PR! Adding LDAP integration tests to the already complex CI set-up of Symfony is a really brave task :) Let's start with a big disclaimer: I've never used LDAP before, so my knowledge about it is very weak. Can you maybe share why a custom docker image was used (instead of semi-official ones like |
lucasaba commentedNov 7, 2020
Well, honestly I'm not into LDAP too. I've just used it for authentication. But I've made a PR which led to a bug that would have been avoided if I had been more accurate with tests. So... this is my way to ask forgiveness.. You're absolutely right: introducing a dependency on a custom image would absolutely be risky. I needed to do it because I needed to push some initial data to the LDAP server, namely, those inthe test env. And it is precisely what I do in my customDockerfile: I create a folder where I store the data and copy it there. Then, withthe env, I tell the image to load it. I think, the best aproach would be to use the standard image and then, add a step in the action, that pushes the data to the server. In order to do that I should use some command line program like Another way would be to create a custom action, which would lead to tha same problem as having a custom docker image. |
derrabus commentedNov 7, 2020
If we really need a custom image (which I'd like to avoid), we should move its maintenance this this repository or at least a repository within the Symfony organization. |
jderusse commentedNov 7, 2020
we even don't need a docker image. Github Action can run Dockerfile directly (https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/creating-a-docker-container-action) |
wouterj commentedNov 7, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
We can do this without a custom image I think. The following docker compose config (docker compose isn't needed here, it's just more readable than a docker run command imho) sets up the openldap image with our fixture data (as far as I can see): version:'3.0'services:ldap:image:osixia/openldap:1.4.0ports: -3389:389volumes: -./src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldifcommand:--copy-service --loglevel debugenvironment:LDAP_DOMAIN:symfony.comLDAP_BASE_DN:dc=symfony,dc=comLDAP_ADMIN_PASSWORD:'symfony' Please note that I can't make the tests pass with this config, so something isn't quite right. But it at least is a start to get custom data in the openldap image without using a custom image. |
lucasaba commentedNov 7, 2020
@wouterj I've tryed your suggestion. seemd promising! I've mounted a volume with the GHA: openldap:image:osixia/openldap:1.4.0options:-v ${{ github.workspace }}/src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif:/ldif-dataports: -3389:389env:LDAP_DOMAIN:"symfony.com"LDAP_ADMIN_PASSWORD:symfonyLDAP_BASE_DN:"dc=symfony,dc=com"LDAP_SEED_INTERNAL_LDIF_PATH:"/ldif-data" But in the I'll try some alternatives and read the article pointed from@jderusse |
lucasaba commentedNov 8, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
At a first impression, that would move the problem. In the sense that, instead of maintaing a docker image, there should be a GHA to maintain. |
wouterj commentedNov 8, 2020
Hmm, according toactions/checkout#211 (comment) the solution would be to run this command before the checkout action: |
lucasaba commentedNov 8, 2020
My bad@jderusse ! Indeed, we canuse a local action and not depenend on an external one. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
jderusse commentedNov 16, 2020
chalasr commentedNov 16, 2020
Rebase went wrong? It seems that an unrelated commit landed in this PR3510b67 |
lucasaba commentedNov 16, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
derrabus commentedNov 16, 2020
@chalasr is right, that does not look right. The content of that commit looks okay, but message and author are from a different PR. |
jderusse commentedNov 16, 2020
Yeah, the commit was there in the original PR (lucasaba@9de6771) I can reword it or squash it if you want@derrabus |
derrabus commentedNov 16, 2020
Right now, the commit message is misleading and I'm the author of that commit. I think, squashing it into the second commit and removing me as author would be good. 😃 |
Adds ext-ldap on github-actions
wouterj left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't really understand anything about what's happening here, but it seems to make the LDAP tests run successfully 👍
Should this also remove the - now unused -src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf andsrc/Symfony/Component/Ldap/Tests/Fixtures/data/base.ldif files?
(unrelated, but I'm a bit scared by amount of integration tests that are skipped on our CI)
jderusse commentedNov 16, 2020
For the record. This PR update the CI to:
Then it fixes tests:
So do I.. Shall we run tests with option -vv to see the reason of skipped tests? |
derrabus commentedNov 16, 2020
Yes, that would be good. Integration tests are often skipped if an external system is not available. If we have a CI run dedicated to integration tests, skipped tests are likely an accident. |
jderusse commentedNov 16, 2020
Done. We have ~200 skipped tests for the following reasons:
I'm checking for the REDIS_SENTINEL test. |
derrabus commentedNov 16, 2020
All right, none of them is related to LDAP, so this PR should be good. |
wouterj commentedNov 16, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
(fwiw, let's move the conversation of the skipped tests to another PR/issue, so we can merge this asap) |
derrabus commentedNov 16, 2020
Thanks@lucasaba. |
lucasaba commentedNov 16, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you all guys. As usual, has been a pleasure and a privilege. Learned a lot! |
derrabus commentedNov 16, 2020
I'll merge this up to 5.1 now. Let's hope, the tests stay green. 😃 |
derrabus commentedNov 16, 2020
derrabus commentedNov 16, 2020
Anyone up for a quick fix before I move on to 5.2? 😁 |
wouterj commentedNov 16, 2020
|
derrabus commentedNov 16, 2020
That makes sense. I've extracted that variable on 4.4 already, in order to keep the diff small.#39094 |
This PR was merged into the 4.4 branch.Discussion----------[Ldap] Fix undefined variable $con| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |#39030 (comment)| License | MIT| Doc PR | N/AThis PR extracts the connection resource into a variable. This will fix an undefined variable error on 5.1.Commits-------15da316 [Ldap] Fix undefined variable $con.
derrabus commentedNov 16, 2020
The LDAP integration tests are now green on 5.1, 5.2 and 5.x. 🎉 |
jderusse commentedNov 16, 2020
thank you for your help@lucasaba . It helped to detect issue in 5.1 if I understand well, and would have prevent bugs in previous PRs. 🎉 |
lucasaba commentedNov 16, 2020
Ok, now I'm really flattered! You've made my day!!!!! ❤️ |
Adds LDAP test on github actions pipeline and corrects sum bugs in the LDAP Component test
It also adds a bug resolution from@Nek- made in#38875