Giter Club home page Giter Club logo

Comments (12)

sholladay avatar sholladay commented on June 23, 2024

I am going to be helping out on this. Documenting my requirements here for completeness, though it goes beyond the scope of the original request.

Version math. This means being able to say latest - 1, latest - 2, etc. to keep up to date while still supporting slightly older versions that are still in the wild. I don't see any need for + or other operators.

Version ranges. For example, Internet Explorer 9 - 11, Chrome 45 - latest, etc. to succinctly represent more than one or two configurations that are otherwise the same. The DRY mantra applies here.

I'm not sure whether using different syntax for each vs just treating latest as a special case would be more intuitive (can't think offhand of any time you would start a range with latest -). If the above looks ambiguous, ranges could use 9..11, 9 to 11, etc.

An easy way of dealing with some of this would be to embrace actual semver, which many Intern users will already be familiar with. The browsers don't even have to be compliant for this to work well. However, I don't believe it has a way to say latest - 2.

from digdug.

jason0x43 avatar jason0x43 commented on June 23, 2024

Also consider SauceLabs Selenium version spec. They support latest - x now as a standard capability.

Note that we can already do version ranges in a sense by specifying multiple versions in an array for version.

If by semver you mean npm's version ranges, I could see that being potentially useful. Is it common for people to want to test ranges of more than a couple browser versions, or more than a couple that aren't contiguous with 'latest'?

from digdug.

jason0x43 avatar jason0x43 commented on June 23, 2024

By 'consider SauceLabs' I just mean that they have a syntax for this now, so it may be good to follow, particularly since it would basically be a pass-through for the SauceLabsTunnel.

from digdug.

sholladay avatar sholladay commented on June 23, 2024

Also consider SauceLabs Selenium version spec. They support latest - x now as a standard capability.

Yeah, BrowserStack has something similar. Would be nice to see a standard across providers, but I'm not holding my breath. :)

Note that we can already do version ranges in a sense by specifying multiple versions in an array for version.

This works well for some things. But it breaks down when it comes time to say Safari 6 - latest, etc. I want to pick up new versions of Safari automatically, but support a minimum version.

If by semver you mean npm's version ranges, I could see that being potentially useful. Is it common for people to want to test ranges of more than a couple browser versions, or more than a couple that aren't contiguous with 'latest'?

This is probably more of a power user case, but yeah that's happened to me on enterprise applications now and then. We need to support a slew of installations, but some new browser comes out that breaks things and it takes us a while to respond with a real fix. In the meantime, we can't support anything past a certain version.

from digdug.

devpaul avatar devpaul commented on June 23, 2024

Howdy,

I have a work in progress supporting 'previous' and 'latest' version aliases on my digdug fork. It should be pretty straight forward to extend it to use latest-x nomenclature. Please have a look.

Tunnel: https://github.com/devpaul/digdug/blob/version_alias/Tunnel.js#L559-L573

SauceLabsTunnel: https://github.com/devpaul/digdug/blob/version_alias/SauceLabsTunnel.js#L461-L472

BrowserStackTunnel: https://github.com/devpaul/digdug/blob/version_alias/BrowserStackTunnel.js#L270-L323

from digdug.

jason0x43 avatar jason0x43 commented on June 23, 2024

Yeah, BrowserStack has something similar. Would be nice to see a standard across providers, but I'm not holding my breath. :)

Browserstack's only works with their JS provider, which uses some BS-specific APIs to get information about available browsers. Sauce's works through the standard Selenium capabilities interface, which is much more convenient (for us). However, Sauce's implementation won't work for ranges, so in that respect it really doesn't buy us much.

I want to pick up new versions of Safari automatically, but support a minimum version.

Makes sense.

So maybe we just need 2 syntaxes, at least for now, something like 'latest - x' and 'version1 .. version2' (e.g., '6 .. latest - 1')?

from digdug.

devpaul avatar devpaul commented on June 23, 2024

I'm updating the code to support a more complex set of ranges, aliases, and math.

Supported version types and ranges:

  • single version: 9
  • ranged version: 9..11
  • latest keyword: latest
  • previous keyword: previous
  • ranged version with alias: 9..latest
  • mathed version alias: latest-2
  • ranged mathed version alias: latest-2...latest

from digdug.

sholladay avatar sholladay commented on June 23, 2024

Sweet. :)

Personally, I don't think previous should be a thing if we have math. It's not shorter, or clearer, or any other benefit I can see. But it is more to support and maintain, document, etc. Just my two cents.

from digdug.

devpaul avatar devpaul commented on June 23, 2024

Personally, I don't think previous should be a thing if we have math. It's not shorter, or clearer, or any other benefit I can see. But it is more to support and maintain, document, etc. Just my two cents.

Since we are already supporting latest it is trivial to support previous. It occupies 2 lines of code and it may be useful for those who wish to explicitly list versions without using ranges.

environments: [
    { browserName: 'firefox', version: 'latest' },
    { browserName: 'firefox', version: 'previous' },
]

If somebody wants to use previous, especially if they've used it in other contexts, I'm ok with that.

from digdug.

sholladay avatar sholladay commented on June 23, 2024

Fair enough. Just my Python background peeking through. :)

from digdug.

jason0x43 avatar jason0x43 commented on June 23, 2024

Hmmm...I agree with @sholladay regarding 'previous'. In general, Intern prefers to have only one way to do things.

from digdug.

jason0x43 avatar jason0x43 commented on June 23, 2024

This has been added in commits 96aa488 and theintern/intern@ab9a245. Thanks @devpaul! It will be included in the next releases of Dig Dug and Intern.

from digdug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.