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

Add automated travis tests and cherry pick #10 #11

Merged
merged 7 commits into from
Mar 26, 2020

Conversation

convenient
Copy link
Contributor

This is quite a big PR, but I believe it all makes sense.

The reason for this PR are twofold

Travis will run 2 builds

  • one against 2.3.3 which we know the issue was present in
  • one against the latest version of magento

Addition of test suite

I have added a codeception test suite which creates a product, adds to basket, checks out and then does assertions for each of the features listed in the README.md

See

In order to do this I had to move all the existing code into the src directory and update the composer.json. This is because otherwise magento was detecting PHP code in the dev directory and trying to include it in the di:compile

The suite spins up a fully fledged instance of Magento 2 by using https://github.com/AmpersandHQ/travis-vanilla-magento which is ultimately powered by https://store.fooman.co.nz/blog/no-authentication-needed-magento-2-mirror.html

Cherry picking #10 - Use plugin after place instead of observer after save

I added a test to capture the error reported in #10 see 454faf8

You can see it failed here https://travis-ci.org/github/AmpersandHQ/magento2-disable-stock-reservation/builds/665961249

1) CheckoutCest: Repeat saves of order do not decrement quantity un
 Test  tests/acceptance/CheckoutCest.php:repeatSavesOfOrderDoNotDecrementQuantityUn
 Step  Assert equals 98,"93.0000","The quantity should have gone down by 1"
 Fail  The quantity should have gone down by 1
Failed asserting that '93.0000' matches expected 98.0.

When I cherry picked in the commit from #10 the suite went green. See 3c48dbd and https://travis-ci.org/github/AmpersandHQ/magento2-disable-stock-reservation/builds/665975512

convenient and others added 5 commits March 17, 2020 09:01
This prevents DI compile picking up ./dev test code
 Conflicts:
	Observer/SourceDeductionProcessor.php
	Plugin/SourceDeductionProcessor.php
	src/Observer/SourceDeductionProcessor.php
@convenient convenient changed the title Add automated travis tests and cherry pick https://github.com/AmpersandHQ/magento2-disable-stock-reservation/pull/10 Add automated travis tests and cherry pick #10 Mar 23, 2020
@convenient
Copy link
Contributor Author

convenient commented Mar 23, 2020

The PR build has failed because of merging shenanigans. It runs as the target branch (master) so pulls in the dev-master branch which doesnt have the fix.

The push build uses the current branch which has the fix.

I've disabled the PR builds in travis config so that future bug fixes don't look so weird.

Once this gets merged I'm confident master will be green.

Add the string in the commit message to set the -vvv flag
@convenient convenient force-pushed the add-automated-travis-tests branch from 3132977 to 27cb351 Compare March 23, 2020 18:27
test VERBOSE
@convenient convenient merged commit d33192c into master Mar 26, 2020
@convenient convenient deleted the add-automated-travis-tests branch March 26, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anyway to disable stock reservation?
3 participants