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

Relocate Tests #897

Merged
merged 6 commits into from
Apr 29, 2019
Merged

Relocate Tests #897

merged 6 commits into from
Apr 29, 2019

Conversation

plessbd
Copy link
Contributor

@plessbd plessbd commented Apr 19, 2019

The first commit is just a bunch of git mv folders.

git mv open_xdmod/modules/xdmod/regression_tests tests/regression
git mv open_xdmod/modules/xdmod/automated_tests/ tests/ui
git mv open_xdmod/modules/xdmod/component_tests/ tests/component
git mv open_xdmod/modules/xdmod/tests/ tests/unit
git mv open_xdmod/modules/xdmod/integration_tests/ tests/integration
git mv tests/xdmod-test-artifacts/xdmod tests/artifacts/xdmod
git mv tests/artifacts/xdmod/automated_tests tests/artifacts/xdmod/ui

The second is where the actual changing of files takes place.

The third commit is cleaning up the artifacts/xdmod/ json files

for file in `find . -type f -name '*.json'`; do echo $file && jq . -- "$file" >| /tmp/cleaned.json && \mv -f /tmp/cleaned.json "$file"; done

fourth commit fixes one last travis error.

tests is a wonderful directory for things such as regression, integration, ui, and unit tests to be located.

so I moved them there

automated_tests is a dumb name (thanks @plessbd) these have been renamed to ui
no need to have _tests in the folder names anymore since these are now properly located in a test directory

tests/ci

  • .secrets.json isnt a secret to anyone so created that under here so it doesnt ahve to be copied around
  • the scripts needed for ci are now here instead of under integration_tests/scripts

@plessbd plessbd mentioned this pull request Apr 19, 2019
@plessbd plessbd changed the title Reloc tests take 3 Relocate Tests Apr 19, 2019
@plessbd plessbd added this to the 8.5.0 milestone Apr 19, 2019
@plessbd plessbd added autodoc:ignore Auto documentation ignore this PR data quality Data quality issues such as improvements to sql queries to improve precision or consistency qa / testing Updates/additions to tests labels Apr 19, 2019
@plessbd plessbd force-pushed the reloc-tests-take-3 branch 6 times, most recently from d4cfe6b to 154f5e3 Compare April 23, 2019 17:27
@plessbd plessbd changed the base branch from xdmod8.1 to xdmod8.5 April 23, 2019 19:05
@plessbd plessbd requested a review from eiffel777 April 29, 2019 12:32
@plessbd plessbd force-pushed the reloc-tests-take-3 branch 2 times, most recently from e9766d7 to 5479a0a Compare April 29, 2019 15:55
@@ -45,7 +45,7 @@ public function testNoExceptionCode()
public function testExceptionCode()
{
$msg = "Code = 10";
$excpectedMsg = (string) $this->loggable . " $msg";
$expectedMsg = (string) $this->loggable . " $msg";
Copy link
Member

Choose a reason for hiding this comment

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

How did this test pass before?

Copy link
Contributor Author

@plessbd plessbd Apr 29, 2019

Choose a reason for hiding this comment

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

They were not running before, and currently are not running now. working with @ryanrath, @chakrabortyr, and @smgallo to get tests running and fix errors

@@ -210,7 +210,7 @@ protected function createUser(array $options)
$institution = isset($options['institution']) ? $options['institution'] : -1;
$firstName = isset($options['first_name']) ? $options['first_name'] : 'Test';
$lastName = isset($options['last_name']) ? $options['last_name'] : 'User';
$emailAddress = isset($option['email_address']) ? $options['email_address'] : $username . self::DEFAULT_EMAIL_ADDRESS_SUFFIX;
$emailAddress = isset($options['email_address']) ? $options['email_address'] : $username . self::DEFAULT_EMAIL_ADDRESS_SUFFIX;
Copy link
Member

Choose a reason for hiding this comment

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

How did this test pass before?

Copy link
Contributor Author

@plessbd plessbd Apr 29, 2019

Choose a reason for hiding this comment

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

They were not running before, and currently are not running now. working with @ryanrath, @chakrabortyr, and @smgallo to get tests running and fix errors

@@ -218,7 +218,7 @@ exports.config = {
if (webdriverHelpers.hasOwnProperty(extension) && typeof webdriverHelpers[extension] === 'function') {
browser.addCommand(extension, webdriverHelpers[extension].bind(browser));
} else {
console.warning('Not Adding: ', extension, typeof webdriverHelpers[extension]);
process.stderr.write('Not Adding: ' + extension + typeof webdriverHelpers[extension]);
Copy link
Member

Choose a reason for hiding this comment

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

Note that this code will produce different output to the previous code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, however, this is for the most part only for "developers" when running this and should rearely if ever be hit.

If you look in `assets/copy-caches.sh` you will see all of the files that will be put into place.

### vimrc
This is just some defaults for VIM when useing the docker for development
Copy link
Member

Choose a reason for hiding this comment

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

s/useing/using/

@plessbd plessbd merged commit 8e9ea0e into ubccr:xdmod8.5 Apr 29, 2019
@plessbd plessbd deleted the reloc-tests-take-3 branch April 29, 2019 19:08
jpwhite4 added a commit to jpwhite4/xdmod that referenced this pull request Apr 30, 2019
ryanrath added a commit to ryanrath/xdmod that referenced this pull request May 6, 2019
Fixing issues introduced by ubccr#897. Mostly it was just updating hard coded paths,
but there are a few places where the format of the expected data json files are
important ( ETLv2 Directory Scanner Tests ). This required re-formatting of the
affected files per their use case. The
ryanrath added a commit to ryanrath/xdmod that referenced this pull request May 7, 2019
Fixing issues introduced by ubccr#897. Mostly it was just updating hard coded paths,
but there are a few places where the format of the expected data json files are
important ( ETLv2 Directory Scanner Tests ). This required re-formatting of the
affected files per their use case. The
ryanrath added a commit that referenced this pull request May 14, 2019
* Updated to allow query descriptors to control visibility

** acl-config **
Previously we only allowed statistics to determine if an `acl_group_by` record
was visible or not. But our config files seem to indicate that certain query
descriptors should be able to control their ability to be shown as well. To
support both of these use cases the `processQueryDescriptors` function in
`acl-config` has been updated to take into account the `hide` property defined
at the query descriptor level and the `visible` property defined at the
statistic level. The logic used to determine the final visibility of an
`acl_group_by` record is as follows.

- By default all entries are shown
- If `visible` is defined then we use it's value.
- Else, if `hide` is defined then we use it's value.

Also, there was a minor refactor with the removal of the `$enabled` variable.
The `$disable` variable that it was based on was never going to be null, so it's
use could be replaced w/ just `!$disable`.

** Acls **
There was some minor cleanup done because it was determined that we always want
to have the `visible` column included, not just when a `$statisticName` is
provided.

This allowed us to move the `$descripter->setShowMenu(...)` from out of the
`if(isset($statisticName)) { ... }` guard so that all query descriptors
generated by this function will have their `showMenu` property populated.

These two sets of changes work together to allow us to control our UI state as
we expect to.

* Fixing Tests

Fixing issues introduced by #897. Mostly it was just updating hard coded paths,
but there are a few places where the format of the expected data json files are
important ( ETLv2 Directory Scanner Tests ). This required re-formatting of the
affected files per their use case. The

* Adding a step to account for the User Profile Prompting

The User Profile pops up to prompt the user to double check their email address.
This means that the ext-mask-msg will be present until the user clicks close,
thus causing a problem for the `Logout` step.

* Style Fixes

* Adding tests for `get_menus` endpoint

This is just the initial bootstrap commit for the new `get_menus` endpoint
integration tests.

* Adding additional Tests

Added tests for `controllers/user_interface.php/operation=get_menus` and for
`Acls::getDisabledMenus`. `get_menus` is the endpoint that provides the list of
of query descriptors visible to the user. While `getDisabledMenus` provides the
list of query descriptors that are disabled. This should provide us a with a set
of happy path tests for these two sets of functionality that can later be
expanded upon as needed.

* Updated artifacts to be posix compliant

aka. added newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autodoc:ignore Auto documentation ignore this PR data quality Data quality issues such as improvements to sql queries to improve precision or consistency qa / testing Updates/additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants