Skip to content
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

This things here do um Test stuffs moar better #4

Merged
merged 3 commits into from Apr 6, 2020

Conversation

pookmish
Copy link
Contributor

@pookmish pookmish commented Apr 1, 2020

READY FOR REVIEW

Summary

  • Allow for different codeception test execution
  • Target only the cardinal service profile for codeception testing at this time.

Need Review By (Date)

-4/8

Urgency

  • medium

Steps to Test

  1. review circleci tests
  2. optionally checkout this branch and run blt codeception cardinal_service_profile to test against a local site.

See Also

@sherakama sherakama changed the title Test stuff more better Test stuffs moar better Apr 1, 2020
@pookmish pookmish changed the title Test stuffs moar better This things here do um Test stuffs moar better Apr 1, 2020
@pookmish pookmish requested a review from sherakama April 1, 2020 05:36
@pookmish pookmish requested a review from jbickar April 1, 2020 05:36
@sherakama
Copy link
Member

https://media2.giphy.com/media/xT5LMX35vqdZXjOt6o/giphy.gif?cid=ecf05e4766d8907f4313320372da07f399fcba919c3df6c4&rid=giphy.gif

@jbickar
Copy link
Contributor

jbickar commented Apr 1, 2020

I guess I'm going to have to be the one to set up Lando on this application if I want to use it to test locally.

@jbickar jbickar mentioned this pull request Apr 1, 2020
@pookmish
Copy link
Contributor Author

pookmish commented Apr 1, 2020

@jbickar multisite lando requires more than just those configs. see https://github.com/SU-HSDO/suhumsci/blob/develop/lando/default.lando.yml that Shea put togeather

@sherakama
Copy link
Member

@jbickar multisite lando requires more than just those configs. see https://github.com/SU-HSDO/suhumsci/blob/develop/lando/default.lando.yml that Shea put togeather

Yeah, that might be handy. Thanks for the reminder.

@jbickar
Copy link
Contributor

jbickar commented Apr 2, 2020

Agreed that multisite lando config is moar better (and I'll add that), but it should work on the default site with only one configured, correct?

Which site in the multisite does blt codeception cardinal_service_profile run on?

@pookmish
Copy link
Contributor Author

pookmish commented Apr 2, 2020

Which site in the multisite does blt codeception cardinal_service_profile run on?

It runs on the URL that is configured in tests/codeception/acceptance.suite.yml. That file is generated at the beginning of the blt codeception command if it doesn't exist. The tests are for the cardinal_service_profile so if you wish to test on the default directory, you'd have to make a few changes to the settings on that directory and then install the profile there.

@jbickar
Copy link
Contributor

jbickar commented Apr 2, 2020

optionally checkout this branch and run blt codeception cardinal_service_profile to test against a local site.

That is the suite I am trying to run, per the testing instructions.

It runs on the URL that is configured in tests/codeception/acceptance.suite.yml. That file is generated at the beginning of the blt codeception command if it doesn't exist. The tests are for the cardinal_service_profile so if you wish to test on the default directory, you'd have to make a few changes to the settings on that directory and then install the profile there.

I am not seeing in tests/codeception/acceptance.suite.yml where it is defining a site within the multisite to run on. I see uri: 'appserver/' passed to drush.

lando blt codeception cardinal_service_profile
We strive to give you the best tools for development.
You can really help us improve by sharing anonymous performance and usage data.

 Do you want to help us make this tool even better? (y/n) n
Ok, no data will be tracked and reported.
We take privacy seriously.
[Filesystem\FilesystemStack] mkdir ["/app/tests/codeception/acceptance/20200402-1613"]
[Remote\Rsync] Running rsync --recursive /app/docroot/profiles/custom/cardinal_service_profile/tests/codeception/acceptance/ /app/tests/codeception/acceptance/20200402-1613
[Remote\Rsync] Done in 0.048s
[Exec] Running vendor/bin/codecept run acceptance --steps --config=tests --html --xml
Codeception PHP Testing Framework v4.1.4
Powered by PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
Running with seed: 


In DrupalKernel.php line 377:
                                                                    
  [Symfony\Component\HttpKernel\Exception\BadRequestHttpException]  

@pookmish
Copy link
Contributor Author

pookmish commented Apr 2, 2020

Drupal docroot
Testable domain
Multisite domain
Browser test url
Path to drush

All of these values get generated by your local.blt.yml settings.

@jbickar
Copy link
Contributor

jbickar commented Apr 2, 2020

OK, I'm having trouble getting this up and running locally with Lando, even with the multisite config and adding a uri in blt/local.blt.yml. I will grab some time with you and @sherakama to troubleshoot.

@jbickar
Copy link
Contributor

jbickar commented Apr 2, 2020

Lando config

blt/local.blt.yml:

# Override any settings as necessary by copying to local.blt.yml
project:
 local:
   protocol: http
   hostname: appserver/
   uri: https://cardinalservice.lndo.site
drupal:
  db:
    username: drupal
    password: drupal
    host: database
tests:
  selenium:
    url: http://chromedriver:4444/wd/hub
behat:
  selenium:
    url: http://chromedriver:4444/wd/hub
  chromedriver:
    url: http://chromedriver

@jbickar
Copy link
Contributor

jbickar commented Apr 3, 2020

This things here do um Test stuffs moar better

OK, @pookmish and I spent about an hour hammering on this today. Here are my notes; additional PR for Lando forthcoming.

General Notes

  • lando blt blt:init:settings generates blt/local.blt.yml from lando/example.local.blt.yml (is that right?)
  • tests/codeception/acceptance.suite.yml gets generated by BLT based on values in blt/local.blt.yml
  • Need to uninstall simplesamlphp_auth on local for running codeception tests
  • When codeception fails, re-runs puke on some of the files in the root artifacts directory
  • You can pass --site=cardinalservice to lando blt drupal:install

TODOs

  • Modify lando/example.local.blt.yml (JB)
  • Add a lando/local.sites.php file and copy it into the init-lando composer script (JB)
  • Update README for lando (JB)
  • Disable healthcheck for lando(JB), e.g.,:
  database:
    type: mysql:5.7
    creds:
      user: drupal
      password: drupal
      database: drupal
    healthcheck:
  • Add some logic to codeception integration to handle errors with the artifacts directory (MD)

@pookmish
Copy link
Contributor Author

pookmish commented Apr 6, 2020

FINE I will push the button. 🙄

@sherakama
Copy link
Member

ci/circleci: run-codeception-acceptance isn't reporting back as successful?

@jbickar as of 5 minutes ago: lando/lando#1088
Looks like an upcoming release will fix the healthcheck issue.

@pookmish pookmish merged commit 30d74b3 into 1.x Apr 6, 2020
@pookmish pookmish deleted the better-codeception-tests branch April 6, 2020 20:18
@sherakama
Copy link
Member

WHAT ABOUT THE STALLED CHECK?

@pookmish
Copy link
Contributor Author

pookmish commented Apr 6, 2020

run-codeception-acceptance was removed. i just have to remove it from the repo settings

@sherakama
Copy link
Member

Got it. Thanks. I'll hit the... oh.

@pookmish
Copy link
Contributor Author

pookmish commented Apr 6, 2020

Why can't i find where to remove that.... 🤔

@pookmish
Copy link
Contributor Author

pookmish commented Apr 6, 2020

nvm. found it

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.

None yet

3 participants