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

Fix the Travis build #174

Merged
merged 36 commits into from
Jan 22, 2020
Merged

Fix the Travis build #174

merged 36 commits into from
Jan 22, 2020

Conversation

nylen
Copy link
Contributor

@nylen nylen commented Jan 13, 2020

All Submissions:

Changes proposed in this Pull Request:

Fix the automated tests running on Travis CI.

This probably won't be fully working yet. As a first step I copied a section from the WooCommerce .travis.yml that looks related to the first issue that CC has been having with Travis CI builds ("Error establishing a database connection").

nylen and others added 5 commits January 12, 2020 21:23
- Now wp-coding-standards/wpcs and wimg/php-compatibility are dependencies of WooCommerce Sniffs.
- Updated wp-coding-standards/wpcs to 1.1.
- Updated wimg/php-compatibility to 9.0.
@bahiirwa
Copy link
Collaborator

This is a good start. At least the tests are running.

@nylen
Copy link
Contributor Author

nylen commented Jan 15, 2020

Let's leave this one open until we can make some more progress.

@nylen
Copy link
Contributor Author

nylen commented Jan 21, 2020

Lines in phpcs.xml (and composer dependencies) were removed when applying woocommerce/woocommerce#21846 / woocommerce/woocommerce@9cb219d / 76336fe.

I guess at some point we'll want to look into whether these coding style rules are still active and whether we still want them. For now I'll focus on getting more things working.

claudiosanches and others added 3 commits January 21, 2020 18:30
Conflicts:
  composer.json
  composer.lock
  tests/bootstrap.php

Merges woocommerce/woocommerce#24197 / woocommerce/woocommerce@67212d1 to Classic Commerce.
Conflicts:
  tests/bootstrap.php
  tests/includes/speed-trap-listener.php

Merges woocommerce/woocommerce#24197 / woocommerce/woocommerce@838dd31 to Classic Commerce.
@nylen
Copy link
Contributor Author

nylen commented Jan 22, 2020

The last few commits should fix the following error:

2020-01-22T00-44-07Z

seeing a lot of these in the tests where the number format in a number
stored as a string is not coming through as expected (test expects
'20', code returns '20.00')
When the old value for these options is not set, they get set to e.g.
' 1017' which gets trimmed to '1017' at some point during the code path.
Avoid this issue by setting to 'random 1017' instead.

TODO: why are these option values blank on Travis?
There is a new 'cc_version' response key for this endpoint.

Let's also go ahead and test all of the response keys from this endpoint
instead of just the number of keys.
The main class name is still WooCommerce for compatibility.
We need to merge woocommerce/woocommerce#25378
and any other related changes in order to get these working again.
This function really shouldn't be used outside of the automated tests!
@nylen
Copy link
Contributor Author

nylen commented Jan 22, 2020

The last few commits should fix the following error [declaration of assertNotFalse]:

Scratch that, we need to keep PHPUnit on the 6.x release series instead of upgrading to 7.x because WP 4.9.x / ClassicPress are still on PHPUnit 6.x.

This plugin is activated on the test site, and it needs to be present or
the "system status" endpoint will fail.
@codecov-io
Copy link

codecov-io commented Jan 22, 2020

Codecov Report

❗ No coverage uploaded for pull request base (develop@01a764d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #174   +/-   ##
==========================================
  Coverage           ?   40.82%           
  Complexity         ?    13445           
==========================================
  Files              ?      367           
  Lines              ?    51271           
  Branches           ?        0           
==========================================
  Hits               ?    20932           
  Misses             ?    30339           
  Partials           ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01a764d...c280209. Read the comment docs.

@nylen
Copy link
Contributor Author

nylen commented Jan 22, 2020

Things to fix after this PR:

  • GeoIP database (related tests are currently disabled)
  • E2E tests
  • PHP 7.4 compatibility

I'll write up appropriate issues for each of these.

I think this PR is ready now but it is worth taking a close look. Happy to answer any questions.

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.

5 participants