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

Correct PID binding tests #144

Merged
merged 1 commit into from Jul 17, 2019
Merged

Conversation

ross-spencer
Copy link
Contributor

@ross-spencer ross-spencer commented Jul 5, 2019

In this commit we make a handful of small changes to make the PID
binding tests pass and slowly start moving to making further use of
AMClient API calls. In this instance, we enable the download of
AIP METS from a Archival Information Package without having to read
it via the selenium driver in the Archivematica ingest browser.

Connected to archivematica/Issues#133
Connected to archivematica/Issues#777

@ross-spencer ross-spencer force-pushed the dev/issue-133-bind-pids-failing branch from a3fd7a7 to 794527d Compare July 5, 2019 14:23
@ross-spencer ross-spencer changed the title WIP: Bind PIDs AMAUAT failing Correct PID binding tests Jul 5, 2019
@ross-spencer ross-spencer marked this pull request as ready for review July 5, 2019 14:27
Copy link
Contributor

@replaceafill replaceafill left a comment

Choose a reason for hiding this comment

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

@ross-spencer This looks good to me. I focused on some of the version specific changes at the beginning but then realized you're proposing we discuss that in general 👍

Just out of curiosity, is there any written document/plan about how are going to transition off selenium?

@@ -451,7 +451,7 @@ def ensure_default_processing_config_in_default_state(self):
)
self.set_processing_config_decision(
decision_label="Select file format identification command (Ingest)",
choice_value="Use existing data",
choice_value="No, use existing data",
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we decided how to approach version-driven changes like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, this definitely lends itself to that conversation. I'll submit something to take care of this for now, and we can open that discussion, possibly in the AM weekly later.

"premis:object/"
"premis:objectIdentifier",
"premis3:object/"
"premis3:objectIdentifier",
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to mention this is another version-based change when I kind of remembered a related comment from you on this. Found it in one of the connected issues description! "Additionally, there is a discussion to be had here about the expectation of the AMAUAT tests to pass against different versions of Archivematica where PREMIS 3 wasn't previously used" 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking through changes in the suite it seems we already have some code already looking for PREMIS3. I'm going to submit a multi-version fix, but I think this makes me want to err on removing multiple versions moving forward. I suspect we can't already get the whole suite to pass on 1.9. IDK though, I haven't as much experience with AMAUAT.

context.am_user.mets.assert_empty_dir_documented_identified(
mets, empty_dir_rel_path
)
assert True
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we document why this has become an empty step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally a mistake on my part. Reinstated the code! Otherwise yes, would totally have documented this! 😜

@@ -85,7 +85,13 @@ def get_event_attr(event_type):
return "{}_event_uuid".format(event_type)


def get_mets_from_scenario(context):
def get_mets_from_scenario(context, api=False):
"""Retrieve the AIP METS file from the AIP package."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (feel free to ignore): this docstring reads strange when compared with the method name (where are we getting the METS from?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's a great point. Just modifying that now!

@ross-spencer
Copy link
Contributor Author

@replaceafill I've given this a second go based on your considered thoughts - if you'd like to re-review?

I feel like a good way forward might be to approve and merge this work (if it passes approval!) then resolve the discussion around versions. And then complete that work separately, e.g. to slowly remove decision points.

Just out of curiosity, is there any written document/plan about how are going to transition off selenium?

None that I am aware of. I imagined it would be an organic thing that falls out of improvements and code-review. For example, in this feature I've approached this from the perspective that we're not testing the mechanism that downloads the METS explicitly. There are other tests that do that too, and so we should focus on the METS once it is available in the AIP which will make the test more robust, like the black-box features, using the API, and then we've one lest test reliant on Selenium and one test that is much less brittle.

But I think we should keep having that discussion if testing the download from the browser mechanism is crucial to any particular test. Or a crucial part of Archivematica that warrants its own test.

For other readers, the proposal to remove the need to create version decision points in the AMAUAT tests is here: archivematica/Issues#778

@@ -109,18 +109,18 @@ def step_impl(context):
"Given that the user has ensured that the default processing config is"
" in its default state\n"
'And the processing config decision "Select file format identification'
' command (Transfer)" is set to "Identify using Fido"\n'
' command (Transfer)" is set to "Yes"\n'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, @replaceafill I just realized that these are version specific too. Will have a look now before review...

@ross-spencer ross-spencer force-pushed the dev/issue-133-bind-pids-failing branch from 83beda1 to e8dea3a Compare July 15, 2019 20:17
@ross-spencer
Copy link
Contributor Author

Hi @replaceafill, I think this is good to re-review now. I have added two commits since the last CR.

  1. I make corrections following CR.
  2. I formatted the steps implementation strings so that they are easier to read. As discussed in Slack, black doesn't complain. I feel like it will help improve readability.

As per this comment we don't need to worry about keeping these tests backwards compatible (thank you for raising those questions as part of your first code-review), so this, once merged, is likely to be the first in a number of related issues that will bring the AMAUAT tests up to the 1.10 standard before we cut a new release.

@replaceafill
Copy link
Contributor

@ross-spencer New commits LGTM 👍

In this commit we make a handful of small changes to make the PID
binding tests pass and slowly start moving to making further use of
AMClient API calls. In this instance, we enable the download of
AIP METS from a Archival Information Package without having to read
it via the selenium driver in the Archivematica ingest browser.
@ross-spencer ross-spencer force-pushed the dev/issue-133-bind-pids-failing branch from e8dea3a to 7ee476d Compare July 17, 2019 15:47
@ross-spencer ross-spencer merged commit 7ee476d into master Jul 17, 2019
@ross-spencer ross-spencer deleted the dev/issue-133-bind-pids-failing branch July 17, 2019 15:52
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.

None yet

2 participants