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

Include version 1.0 extensions in testing and build.py #9812

Merged
merged 7 commits into from Jun 9, 2017
Merged

Include version 1.0 extensions in testing and build.py #9812

merged 7 commits into from Jun 9, 2017

Conversation

honeybadgerdontcare
Copy link
Contributor

No description provided.

@@ -164,11 +164,11 @@ def GenValidatorProtoascii(out_dir):
assert re.match(r'^[a-zA-Z_\-0-9]+$', out_dir), 'bad out_dir: %s' % out_dir

protoascii_segments = [open('validator-main.protoascii').read()]
extensions = glob.glob('extensions/*/0.1/validator-*.protoascii')
extensions = glob.glob('extensions/*/(0.1|1.0)/validator-*.protoascii')
Copy link
Contributor

Choose a reason for hiding this comment

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

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 don't see what that would change since that file does not enumerate all versions. The protoascii should define which tag and extension is for which version.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's why I want to use config from that file. All use 0.1 by default. The only one that needs 0.1|1.0 is amp-sidebar.

I think 0.1|1.0doesn't make sense to upgraded elements. for example extensions/amp-sticky-ad/0.1/validator-*.protoascii exists, but the file is deprecated and should be built/tested no more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though amp-sticky-ad 0.1 is deprecated it is still valid and therefore must still be tested.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. but the function you're changing is to generate validator protoascii. Is that still needed? I think we should always use 1.0 version validator-amp-sticky-ad.protoascii, but test both 0.1 version validator-amp-sticky-ad.html and 1.0 version validator-amp-sticky-ad.html ? Please correct me.

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 design decision that I haven't heard the validator team discuss. One plan we have discussed is to introduce versioning to the tagspecs themselves and also pull the protoascii out of the versioned file but leave the appropriate validator test files with their appropriate versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Like the idea to pull the protoascii out of the versioned file

const testPath = path.join(extension, '0.1', 'test');
if (isdir(path.join(root, testPath))) {
testSubdirs.push({root: root, subdir: testPath});
const extensionVersions = ['0.1', '1.0'];
Copy link
Contributor

Choose a reason for hiding this comment

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

#9730 already made the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, didn't see that in the PR before. Will need to pull it in for internal systems.

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'll also create another PR to add that to the validator light tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I'm going to change this back to being explicit about version numbers rather than just every directory within the extension name.

@ampproject ampproject deleted a comment from amphtml-team Jun 9, 2017
@honeybadgerdontcare honeybadgerdontcare merged commit ebe5dc6 into ampproject:master Jun 9, 2017
@honeybadgerdontcare honeybadgerdontcare deleted the extension-versions branch June 9, 2017 23:51
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.

None yet

5 participants