webdriver-manager update-config.json absolute paths - selenium

At webdriver-manager\selenium\update-config.json for "last" and "all" JSON parameters, I have absolute paths. How I can set relative paths to them?
I tried "..\" and ".\" but it's not working. Any ideas?

You can try to update it like this, it will definitely update it in node_modules/protractor
$./node_modules/protractor/bin/webdriver-manager update

Alright, so this is the design of update-config.json, what it is used for and why it is there.
Write update-config.json during update
When a user calls webdriver-manager update, the binaries are downloaded and renamed to include the version number. This allows a user to have multiple versions of a binary in their output directory. Previously around ~2015, the file would be downloaded and the uncompressed file for ChromeDriver name would just be chromedriver (or chromedriver.exe on Windows). Now, we rename to include the version. So if we downloaded version 2.28, the uncompressed file would be chromedriver_2.28
How this is used by Protractor
Previously (~2015), the driver provider for local and directConnect would make assumptions on the filename. So for our previous example, it would assume that the file was chromedriver (or chromedriver.exe on Windows).
There are a couple of issues with appending a version number:
Protractor does not keep track of the version numbers downloaded by webdriver-manager
Previous assumptions worked by using the config.json for the version number; however, this did not allow a user to download custom versions.
So what happens is that we keep track of the "latest" version downloaded. The last version downloaded by webdriver-manager will be used by Protractor. The "all" field was just a list of versions downloaded. I believe when we call "status" these values are used.
Obviously, if you delete the update-config.json but still have the binaries, Protractor will not find the update-config.json. Therefore it won't be able to run local or directConnect and will complain / ask to run webdriver-manager update.
Why this should not be stored in git
Previous comments ask about storing this value. The idea here is that, just like the binaries and caching files, this file is temporary and should not be stored in git. I actually do not understand the use case where a user wants to have a relative path to the update-config.json but if you need to reference it via code then I would do something like lib/driverProviders/local.ts#L43.

Related

Installed package has out-of-date header files

The node-addon-api package is installed and I have been compiling using those header files just fine. But I went to take advantage of a feature and my addon would not compile; the symbol was missing from the headers. After comparing to the header file in their github repository, it was clear that what's installed is not what's current.
The file dates of everything (on a Windows install) is shown as 26-Oct-1985, but I don't know if that's npm just not getting the date right when it writes the file out, or what.
What do I need to do to get the current version in place? npm reports that v.3.0.2 is installed, but even after deleting the directory and letting npm fetch it again, the files are out-of-date.
This was strange; I finally realized that the reason the file kept looking like it was out of date was because the text editor I had it loaded in was not reloading when the file got rewritten by npm -- probably because of the file's datestamp never changing from 26-Oct-85. I discovered this after taking a diff between the installed file and the one in a clone of the package's repo: no difference.

How do I specify JRE when creating a Bamboo sidekick agent for their per-build-container plug-in?

Trying to get the sidekick image built and having some issues. Is there any documentation other than the README.md file?
My current problem is with getting the JRE requirement working but there are others. The page says "download Oracle JRE and place it inside the working directory. Optionally if you have a company wide distribution url, use that one at a later step." and the help says "Java (JRE) download url or path inside working directory". Have not been able to get this to work.
I went to the JRE link provided and was presented with options to download a rpm file or a tar.gz file. Which is expected (was unable to get either one working)?
It says to place the file in the "working directory" but not sure where exactly. Tried in sidekick folder and in sidekick/jre both without success no matter what I used after the -j command. Is this just the path or should the filename be included as well? Can I get an example?
I'm running this script using my login but noticed the output folder is being created with root user and group. I see no indication that this should be run with sudo. What is the correct way to run this script?
Using debug, I see the function "download if not cached". Can I save these files (JRE, Bamboo jar file, etc.) somewhere so I don't have to worry about downloading them? If so, where should they go? Looks like I might have a problem with the wget to d/l the jar file so would like to just be able to place all these in a folder and be done with it.
It looks like the major problem is the script didn't clean up after itself if it fails. The issue was the first time it failed then that caused subsequent issues as the output folder was already there. Removing this directory between each attempt help.
As for the correct syntax for the -j JRE option I manually downloaded the JRE and placed in a folder called per-build-container/sidekick/stuff/. For the command line it is not just the path but the file name as well (the tar.gz and not the RPM). For my case it was
-j stuff/jre-8u251-linux-x64.tar.gz
Note I also ran the script as sudo. Wasn't stated but seemed to work OK.
Another issue I ran into was the download of the agent jar file. There is a redirect in the wget file that was not working for us. I ended up editing the script and replacing the Altassian based url with the redirected one.
This addresses all the issues I ran into with the initial question.

How to get the conda environment path inside a rule?

On previous versions of Snakemake (tested on 3.9.1 using integration with bioconda --use-conda) I could just check for the md5 hash of the environment.yaml file and find the respective environment at: workdir/.snakemake/conda/md5
On version 4.3.0 the md5 hash of the file does not match the environment folder. Looking at the source code I found out that the full path of the environment file is included when calculating the md5 hash to avoid conda errors on hard-coded paths but I am not sure how to generate the correct hash.
Is there another easier way to get the environment path inside a rule? If not, how can I generate the correct md5 to finde the environment?
Currently, the only reasonable way is to check the log. The path is displayed when the environment is activated. However, it is a very good idea to provide a command line option to list all environments, something like snakemake --list-conda-envs. I will do that as soon as possible.
EDIT: I have implemented --list-conda-envs in the master branch. It will be in the next release.

How to check version of AFNetworking?

I am thinking about upgrading my current project, but I don't know which version I have. Is there a way to tell?
You can always check Podfile.lock it will show you the last version and all its dependencies.
No, you can't.
AFNetworking saves its version to the CHANGES file, you do can't find any version mark in any source files.
If the version number is very important to your project, you can scan the UIKit+AFNetworking folder and AFNetworking folder in the source code hosting on Github. According to commit log, to diff some specific code snippet for checking if it exists in a specific version.
If there's a "CHANGES" file found somewhere within your AFNetworking directory, that should contain the version number.

Is it possible to automatically insert version number in code using bazaar?

I am currently working with a coding project using the bzr (bazaar) source code management software. I would like to include the version number in the file code of my project
So that I could call the variable "VERSION" and echo out my current working version.
Within the code be able to do this:
var VERSION = ###;
Where ### is the current version number. Is this possible? or do I have to inspect the bzr info on a file and increment my version manually prior to committing new code?
The only solution I know is the Keyword plugin for Bazaar:
http://doc.bazaar.canonical.com/plugins/en/keywords-plugin.html
(This points to https://launchpad.net/bzr-keywords but the first link has more explanation).
Steps:
Get the plugin
bzr branch lp:bzr-keywords
Install plugin (basically copy it in bazaar plugins install folder)
Get the help
bzr help keywords
Once installed, commit your code with the keywords inside, it will be replaced.
Another option is to invoke the 'bzr version-info' command, which can output the version number in various convenient ways.