Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jploskonka
Copy link
Contributor

@jploskonka jploskonka commented Oct 13, 2017

I found it quite tricky to figure out how to run all codecept tests. I would really love to have it possible to be able to run all tests with one command. Also manually running php server for helpers tests was little bit irritating for me.

I use Docker a lot in development and don't want to install Selenium locally. @DavertMik I would like to get your opinion on that if it's something you'd consider merging and suggesting as simpler way to contribute.

If you like the idea I can cleanup the code and finish it sometime soon. There's still issue with Appium tests (I didn't have time to fit it yet).

Todo:

  • easy way to run single helper tests
  • Cleanup code
  • green travisCI and Semaphore
  • rest test
  • move docker-compose to test dir
  • acceptance test
  • support node 6 & node 8
  • Update travis config to use dockerized tests
  • README info about using it for development :)

let should = require('chai').should();
let I, browser;
let site_url = 'http://127.0.0.1:8000';
let site_url = 'http://php:8000';
Copy link
Contributor

Choose a reason for hiding this comment

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

(process.env.SITE_URL || 'http://127.0.0.1:8000');

here as well

@DavertMik
Copy link
Contributor

Thanks @jploskonka . This is really great initiative. If you make it work with Appium I will adore you )
I couldn't make it run in Docker. It would be great to have headless mobile tests using Docker. If you make it work I'd add it to documentation as well...

Also, I'd propose to move docker-compose.yml into tests or rename it to docker-compose-test.yml so people knew this file is for internal testing, not for starting a project itself.

And there should be a flexible and documented way to run exact one helper and one test. As running all of them takes lot of time

@jploskonka
Copy link
Contributor Author

I played a bit with Appium today and unfortunately wasn't able to run it :/ My container is always stuck on booting emulator so far:
novnc Not sure if it's stuck or just takes so long to boot on my machine :D

I will give it one more shot this week, if I can't figure anything out I'll focus on getting rest of todos done ;) Still even without appium I think it's beneficial already and we can always work on Appium later. Thanks for your feedback!

@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from 64fac63 to dc82b4f Compare October 17, 2017 19:25
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from 3367573 to 140e48d Compare October 17, 2017 20:22
@DavertMik
Copy link
Contributor

I will give it one more shot this week, if I can't figure anything out I'll focus on getting rest of todos done ;) Still even without appium I think it's beneficial already and we can always work on Appium later. Thanks for your feedback!

Yep, and thanks for your input 🤗. That would be really great to have easy to setup test environment

@jploskonka jploskonka changed the title [idea][work in progress] Dockerized development environment [work in progress] Dockerized development environment Oct 19, 2017
docker-compose run test-helpers test/rest
docker-compose run test-helpers test/rest/ApiDataFactory_test.js
docker-compose run test-helpers test/rest/REST_test.js
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from f3e33d6 to 43eb1c4 Compare October 19, 2017 13:52
@jploskonka
Copy link
Contributor Author

jploskonka commented Oct 19, 2017

@DavertMik Another batch of updates, it's getting more interesting :D

I have problems with test/acceptance. Specs for WebDriver passes OK, but nightmare fails on iframe related examples. I couldn't find info about those specs in contributing.md and also it looks like those aren't run on travisCI nor semaphore. Am I doing something wrong or are those outdated and maybe broken?
I'm also not 100% convinced to separate docker-compose services for each acceptance test, but it's easier to debug it for now ;)

EDIT: Also I noticed that acceptance specs are tagged with @protractor while there's no protractor codecept config ;)

@jploskonka jploskonka changed the title [work in progress] Dockerized development environment [work in progress] Dockerized test environment Oct 19, 2017
@DavertMik
Copy link
Contributor

I have problems with test/acceptance. Specs for WebDriver passes OK, but nightmare fails on iframe related examples. I couldn't find info about those specs in contributing.md and also it looks like those aren't run on travisCI nor semaphore. Am I doing something wrong or are those outdated and maybe broken?

I didn't work with them for a long time so everything is possible 🙃
Please proceed, some tests may be disabled. Esp for Nightmare...

Also I noticed that acceptance specs are tagged with @protractor while there's no protractor codecept config ;)

I found it only here:

Scenario('within on form @WebDriverIO @protractor @nightmare', (I) => {

In this case I think @protractor corresponds to SeleniumWebdriver helper

@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from ad62ba5 to 801a7d3 Compare October 25, 2017 13:22
- Support passing NODE_VERSION as build arg
- Reorder instructions to not reinstall npm packages if package.json
  doesn't change
- Use COPY instead of ADD
- Run unit tests in docker container
- Use generic language instead of node
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from f8332e6 to d40680f Compare October 25, 2017 15:11
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch 5 times, most recently from fe05da3 to 6422d56 Compare October 25, 2017 16:39
- Use dockerized tests on travisCI
- Share node_modules as volume between containers
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from 6422d56 to f7331fa Compare October 27, 2017 11:08
@jploskonka jploskonka changed the title [work in progress] Dockerized test environment Dockerized test environment Oct 27, 2017
@jploskonka
Copy link
Contributor Author

Almost done :D I still see issues mostly with travisCI integration but I'm not sure if this should be tackled in this PR or some other:

When I started working on this PR I didn't intended to use dockerized tests on travis yet, I did it only to check out how it would work and then couldn't resist going further :D I rolled back .travis.yml to version from master and builds are green. I think the best way would be to merge this and I'd like to work further on mentioned issues in separate PRs.

@DavertMik
Copy link
Contributor

DavertMik commented Oct 29, 2017

Thanks!
Maybe we could setup another CI for testing docker container only?
There are still few free CIs so why not to use them. I'd pick Wercker CI http://www.wercker.com as it's already based on Docker container and could be easily set up for it.

I created an account on Wercker and added you as admin. You should receive invitation.
You can use it to run docker tests. Not all CI tests but whatever you think is reasonable

@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch 3 times, most recently from ce89ccf to 393149e Compare November 1, 2017 10:40
@jploskonka jploskonka force-pushed the dockerized-codecept-tests branch from 393149e to 3a04c01 Compare November 1, 2017 10:43
@jploskonka
Copy link
Contributor Author

I played a bit with Wercker and wasn't able to even start containers. I encountered some strange issues with privileges inside containers and gave up for now. I don't have much time this week to work on it ;)

Basically there's a lot of places we can improve this, but I'd like to add next things as separate PRs. Please let me know what do you think is must have to update here so we can get this merged and I can work on CI integration when I have some more time, probably next week :)

@DavertMik
Copy link
Contributor

Thanks, let's switch to something new from Wercker

@DavertMik DavertMik merged commit 65649ca into codeceptjs:master Nov 8, 2017
@jploskonka jploskonka deleted the dockerized-codecept-tests branch November 8, 2017 16:39
@jploskonka jploskonka mentioned this pull request Nov 27, 2017
3 tasks
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