-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Set up end to end Send/Receive testing with LexBox #342
Commits on Jul 25, 2024
-
Add MkFwData and SplitFwData commands to LfMerge
Will be used in end-to-end testing scenarios
Configuration menu - View commit details
-
Copy full SHA for 7a4873e - Browse repository at this point
Copy the full SHA 7a4873eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab49c3b - Browse repository at this point
Copy the full SHA ab49c3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96f5d39 - Browse repository at this point
Copy the full SHA 96f5d39View commit details -
Add methods for resetting projects in LexBox
This will enable setting projects to specific commits before the test.
Configuration menu - View commit details
-
Copy full SHA for 5dd0a60 - Browse repository at this point
Copy the full SHA 5dd0a60View commit details -
Add a basic unit test to exercise project reset
This test can now exercise the "reset project to known revision" functionality in LexBox, proving that it works.
Configuration menu - View commit details
-
Copy full SHA for 05a8c93 - Browse repository at this point
Copy the full SHA 05a8c93View commit details
Commits on Jul 30, 2024
-
Add helper method to clone Lcm project from LexBox
Give it a project code, get an FwProject back, it does the rest. (It's the caller's job to dispose of the FwProject when you're done, though).
Configuration menu - View commit details
-
Copy full SHA for 554bd2e - Browse repository at this point
Copy the full SHA 554bd2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d5d4c9 - Browse repository at this point
Copy the full SHA 4d5d4c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41c58ed - Browse repository at this point
Copy the full SHA 41c58edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83d6e21 - Browse repository at this point
Copy the full SHA 83d6e21View commit details -
Add helper for commit and push
Also add test demonstrating that the helper works, and we can modify an entry's citation form, then push the modified entry to LexBox.
Configuration menu - View commit details
-
Copy full SHA for 2b4e84a - Browse repository at this point
Copy the full SHA 2b4e84aView commit details
Commits on Jul 31, 2024
-
Improve LcmTestHelper method for setting text
Now test code doesn't have to deal with undo/redo accessors.
Configuration menu - View commit details
-
Copy full SHA for 3a54e81 - Browse repository at this point
Copy the full SHA 3a54e81View commit details -
Add test to ensure commit is working
So far the test is failing, so it's not working yet.
Configuration menu - View commit details
-
Copy full SHA for f28c6ef - Browse repository at this point
Copy the full SHA f28c6efView commit details
Commits on Aug 7, 2024
-
Start of new SRTestBase class which will autoreset
Now, if you tag a test with `[Property("projectCode", "sena-3")]` it will automatically restore the sena-3 project to its original state at the end of the test. This will ensure idempotence even if tests fail.
Configuration menu - View commit details
-
Copy full SHA for d2665f5 - Browse repository at this point
Copy the full SHA d2665f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for f273aa6 - Browse repository at this point
Copy the full SHA f273aa6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b844e9 - Browse repository at this point
Copy the full SHA 4b844e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f93dec - Browse repository at this point
Copy the full SHA 6f93decView commit details
Commits on Aug 8, 2024
-
Remove overload of SRTestEnvironment constructor
It's causing overload ambiguity when you create an SRTestEnvironment with no parameters. We'll just pass the port number in as a string.
Configuration menu - View commit details
-
Copy full SHA for fd82dfc - Browse repository at this point
Copy the full SHA fd82dfcView commit details -
Much better setup and teardown in SRTestBase
Now we have one folder per test, and it's deleted afterwards if the test passed. If the test failed, the folder is preserved, but it will be deleted the next time the test runs, so investigate before re-running tests if you need the files in the folder.
Configuration menu - View commit details
-
Copy full SHA for 9d15c3b - Browse repository at this point
Copy the full SHA 9d15c3bView commit details -
Clone, commit, and push tests are now repeatable
Now that temp folders are set up properly, we can run tests that clone, commit, and push repeatedly: the LexBox project is automatically returned to its original state at the end of the test, and the temp folders are cleaned up prior to the next test being run.
Configuration menu - View commit details
-
Copy full SHA for 8399906 - Browse repository at this point
Copy the full SHA 8399906View commit details -
Fix the CommitChanges helper function
Turns out the .fwdata file isn't updated until you call .Commit() on the action handler.
Configuration menu - View commit details
-
Copy full SHA for 37fb990 - Browse repository at this point
Copy the full SHA 37fb990View commit details -
Fix Mercurial commits committing too much
Also renamed CommitChanges to CommitAndPush.
Configuration menu - View commit details
-
Copy full SHA for 7009555 - Browse repository at this point
Copy the full SHA 7009555View commit details
Commits on Aug 9, 2024
-
Make CallLfMergeBridge public so tests can use it
Also make it static so that tests can supply their own dependencies without needing to create an instance of ConvertMongoToLcmComments or ConvertLcmToMongoComments in order to use the method.
Configuration menu - View commit details
-
Copy full SHA for 1bb8789 - Browse repository at this point
Copy the full SHA 1bb8789View commit details -
Add basic (rudimentary, even) test for comments
This causes a .ChorusNotes file to show up in the sena-3 project in LexBox, thereby proving that it can be done. Later we'll turn this into a real round-trip test of some kind.
Configuration menu - View commit details
-
Copy full SHA for c9e6854 - Browse repository at this point
Copy the full SHA c9e6854View commit details
Commits on Aug 13, 2024
-
Refactor, moving HTTP stuff out of LcmTestHelper
LcmTestHelper was the wrong place to put CommitAndPush since that needs to deal with URLs, and URLs are already being dealt with in SRTestEnv.
Configuration menu - View commit details
-
Copy full SHA for fa873e2 - Browse repository at this point
Copy the full SHA fa873e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5055ee2 - Browse repository at this point
Copy the full SHA 5055ee2View commit details -
Refactor SRTestEnv to keep track of URL parts
This will enable other code to just ask the test environment what the lexbox username and password are, and not have to look it up from the environment variables all the time.
Configuration menu - View commit details
-
Copy full SHA for 78bc1f6 - Browse repository at this point
Copy the full SHA 78bc1f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c857ab - Browse repository at this point
Copy the full SHA 6c857abView commit details -
Fix reset-project method failing on existing files
If you run multiple tests that want to reset the same project, the second one was erroring out because the zip file already existed. We now use random names for the files and dirs in the reset-project method so that this cannot occur.
Configuration menu - View commit details
-
Copy full SHA for 213a7df - Browse repository at this point
Copy the full SHA 213a7dfView commit details -
Add ability to make GraphQL queries to LexBox
Plus a basic test demonstrating creating a new project, which will eventually move to the base class or the SRTestEnvironment class.
Configuration menu - View commit details
-
Copy full SHA for 7dfef75 - Browse repository at this point
Copy the full SHA 7dfef75View commit details -
Add other project types even if we won't use them
Even if we won't use other project types than FLEx, might as well keep the enum the same as what LexBox uses, so that if we get a project type response that we didn't expect, System.Text.Json will know how to deserialize it correctly.
Configuration menu - View commit details
-
Copy full SHA for 3c90d12 - Browse repository at this point
Copy the full SHA 3c90d12View commit details -
Ensure sena-3.zip is available to all tests
This gives us a known starting point for all end-to-end tests, without needing to check the .zip file into the LfMerge repo.
Configuration menu - View commit details
-
Copy full SHA for 43c02e7 - Browse repository at this point
Copy the full SHA 43c02e7View commit details -
Move CreateProject into SRTestBase
Now any test method can just create a new project with a single line.
Configuration menu - View commit details
-
Copy full SHA for b0c2fe9 - Browse repository at this point
Copy the full SHA b0c2fe9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99e7384 - Browse repository at this point
Copy the full SHA 99e7384View commit details -
Auto-delete created projects on test success
Failed tests will still leave the project in LexBox so that it can be examined later.
Configuration menu - View commit details
-
Copy full SHA for 9bd0a09 - Browse repository at this point
Copy the full SHA 9bd0a09View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf52e49 - Browse repository at this point
Copy the full SHA bf52e49View commit details -
Attempt to debug teardown race condition
Somehow, if the UploadNewProject test is run after the other BasicTests, Mercurial isn't finding the newly-created project when the UploadZip step runs. However, if UploadNewProject is run in isolation, then Mercurial finds it. This is apparently a race condition involving Mercurial's new project registration, which we can reproduce consistently here. To reproduce, run: dotnet test -l "console;verbosity=normal" --filter=Foo_ We should see: About to reset sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 About to upload /tmp/LfMergeSRTests/data/sena-3.zip to sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Done with reset and upload for sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Created sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Teardown for Foo_UploadNewProject About to delete project ID f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Successfully deleted project ID f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Teardown for Foo_UploadNewProject completed But instead we see: About to reset sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 About to upload /tmp/LfMergeSRTests/data/sena-3.zip to sr-f7f322b8-b6d8-47e9-bb2c-7dd30426a5a1 Teardown for Foo_UploadNewProject Teardown for Foo_UploadNewProject completed And the "Done with reset and upload" step is never reached, becaue the LexBox server returns a 404 on the project when we upload the zip file.
Configuration menu - View commit details
-
Copy full SHA for 238049a - Browse repository at this point
Copy the full SHA 238049aView commit details
Commits on Aug 14, 2024
-
Remove debug logging since race condition is fixed
Race condition fixed in LexBox, so we don't need the Console.WriteLine calls any longer.
Configuration menu - View commit details
-
Copy full SHA for ef5f480 - Browse repository at this point
Copy the full SHA ef5f480View commit details -
Derive SRTestEnv from TestEnv class
Tests continue to pass, so there are no hidden conflicts.
Configuration menu - View commit details
-
Copy full SHA for a18650e - Browse repository at this point
Copy the full SHA a18650eView commit details -
Set env var so FW will use temp folder for storage
FieldWorks and liblcm use the FW_CommonAppData environment variable to locate the folder where they should store things like writing systems downloaded from SLDR. We want it set to a temp folder for E2E tests.
Configuration menu - View commit details
-
Copy full SHA for 221d6c3 - Browse repository at this point
Copy the full SHA 221d6c3View commit details -
Add beginnings of first "real" end-to-end test
Currently pulls project down from LexBox and verifies data. Next step will be to change data in a FieldWorks project, push that to LexBox, and verify that LfMerge can resolve merge conflicts.
Configuration menu - View commit details
-
Copy full SHA for 06ca00c - Browse repository at this point
Copy the full SHA 06ca00cView commit details
Commits on Aug 15, 2024
-
Use static properties for SRTestEnv.HttpClient
This simplifies the constructor a lot and ends up making tests that clone FieldWorks projects a lot easier to write.
Configuration menu - View commit details
-
Copy full SHA for 6af7169 - Browse repository at this point
Copy the full SHA 6af7169View commit details -
Make most SRTestEnv methods static
Most methods in SRTestEnvironment now access only static properties such as the HttpClient, so most of them can now be made static as well.
Configuration menu - View commit details
-
Copy full SHA for adcd8f2 - Browse repository at this point
Copy the full SHA adcd8f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 985683d - Browse repository at this point
Copy the full SHA 985683dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 70e34e8 - Browse repository at this point
Copy the full SHA 70e34e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3fa3660 - Browse repository at this point
Copy the full SHA 3fa3660View commit details
Commits on Aug 19, 2024
-
Clone LF and FW projects with different codes
This will allow us to check out the LF and FW projects separately, to better simulate a true Send/Receive scenario.
Configuration menu - View commit details
-
Copy full SHA for 01364ce - Browse repository at this point
Copy the full SHA 01364ceView commit details -
Working end-to-end Send/Receive test
Our first test from SynchronizeActionTests fully converted to do end-to-end testing with a real LexBox instance, and working.
Configuration menu - View commit details
-
Copy full SHA for 5689335 - Browse repository at this point
Copy the full SHA 5689335View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0158a4 - Browse repository at this point
Copy the full SHA b0158a4View commit details -
Refactor common code, greatly simplifying E2E test
The code for updating glosses in FW and LF can be extracted into the test base class, allowing the individual tests to become a lot more readable as it's clear at a glance what's being updated.
Configuration menu - View commit details
-
Copy full SHA for ab3c21e - Browse repository at this point
Copy the full SHA ab3c21eView commit details -
Final refactoring of first E2E test
The process of doing a Send/Receive to LexBox is also an obvious bit of code to extract into a common method call. With this, the whole E2E test ends up readable without needing to scroll.
Configuration menu - View commit details
-
Copy full SHA for f737703 - Browse repository at this point
Copy the full SHA f737703View commit details -
Configuration menu - View commit details
-
Copy full SHA for aaf4f36 - Browse repository at this point
Copy the full SHA aaf4f36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 16d03cd - Browse repository at this point
Copy the full SHA 16d03cdView commit details -
Remove MkFwData code; we don't need it after all
The E2E tests aren't going to run the MkFwData executable, they're just going to call the LfMergeBridge API directly when needed. Saves time.
Configuration menu - View commit details
-
Copy full SHA for 38fce52 - Browse repository at this point
Copy the full SHA 38fce52View commit details -
Delete more now-unused S/R test code
Now that we're not modifying existing LexBox projects but rather cloning them and creating new projects for each test, we don't need the entire "roll project back to previous revision" code.
Configuration menu - View commit details
-
Copy full SHA for e48052e - Browse repository at this point
Copy the full SHA e48052eView commit details -
Fix creating empty FLEx projects in LexBox
Not used in the current E2E test, but will be used in an upcoming test
Configuration menu - View commit details
-
Copy full SHA for 6d99535 - Browse repository at this point
Copy the full SHA 6d99535View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8db4721 - Browse repository at this point
Copy the full SHA 8db4721View commit details -
Demonstrate another hgweb race condition
Run `dotnet test --filter E2E_` to see `hg clone` return 404 on a newly-created project. Won't happen every single time, but will happen often enough that it's likely to cause problems. Solution is going to be to make CloneRepoFromLexbox more resilient against temporary 404s.
Configuration menu - View commit details
-
Copy full SHA for 779358e - Browse repository at this point
Copy the full SHA 779358eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80d45bb - Browse repository at this point
Copy the full SHA 80d45bbView commit details
Commits on Aug 21, 2024
-
Make most SRTestEnv methods non-static again
As requested in code review
Configuration menu - View commit details
-
Copy full SHA for 3749cbe - Browse repository at this point
Copy the full SHA 3749cbeView commit details -
Allow overriding repo URL in settings, not env vars
This ensures that the override will only affect the test it's set in, rather than potentially affecting other tests if we forget to clear the environment variable in a `finally` block.
Configuration menu - View commit details
-
Copy full SHA for bea1713 - Browse repository at this point
Copy the full SHA bea1713View commit details -
Don't hardcode GUID in LexBox tests
Rather than assume that the test will be running against the sena-3 project, let's make the test grab an arbitrary entry (the first one that the LexEntryRepository knows about) and use it. Since the entry whose GUID we hardcoded was actually the first LexEntry sorted by GUID, this currently has no effect as we're actually testing the same entry we were before — but it will allow us to change the test later.
Configuration menu - View commit details
-
Copy full SHA for 946468d - Browse repository at this point
Copy the full SHA 946468dView commit details -
Consolidate E2E base classes into one base class
Since we're not going to be creating any other test fixtures derived from SRTestBase, there's no point in having two base classes; it has become over-engineering now that we've decided on just one E2E test.
Configuration menu - View commit details
-
Copy full SHA for 5c7059b - Browse repository at this point
Copy the full SHA 5c7059bView commit details -
Ignore E2E tests if LexBox isn't available
Instead of the tests failing if LexBox isn't available, this will just mark them as ignored.
Configuration menu - View commit details
-
Copy full SHA for 129aaa2 - Browse repository at this point
Copy the full SHA 129aaa2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5b5449 - Browse repository at this point
Copy the full SHA a5b5449View commit details
Commits on Aug 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0af5fb2 - Browse repository at this point
Copy the full SHA 0af5fb2View commit details -
Replace unmaintained TUS library with newer one
Newer library allows passing in an HttpClient, so we don't have to copy cookies around.
Configuration menu - View commit details
-
Copy full SHA for b3e258d - Browse repository at this point
Copy the full SHA b3e258dView commit details -
Dispose SRTestEnv during test TearDown method
We keep the temp directory around if the test failed, but we dispose everything else.
Configuration menu - View commit details
-
Copy full SHA for 5fe1d6d - Browse repository at this point
Copy the full SHA 5fe1d6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 52017e9 - Browse repository at this point
Copy the full SHA 52017e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1eea903 - Browse repository at this point
Copy the full SHA 1eea903View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d1e52f - Browse repository at this point
Copy the full SHA 0d1e52fView commit details
Commits on Aug 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6844012 - Browse repository at this point
Copy the full SHA 6844012View commit details -
Dispose of FileStream after TUS upload
The library doesn't do this for us. This would be unsafe if we weren't awaiting the result of TusPatchAsync, but by the time TusPatchAsync returns, the FileStream is no longer needed.
Configuration menu - View commit details
-
Copy full SHA for 0f10f6b - Browse repository at this point
Copy the full SHA 0f10f6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f09fc0 - Browse repository at this point
Copy the full SHA 9f09fc0View commit details