How to run multiple specs folders? - cypress

I have a multiple folder on cypress
cypress/e2e/1. Folder1
cypress/e2e/2. Folder2
cypress/e2e/3. Folder3
I know how to run it on a single folder using cypress run --browser chrome --spec 'cypress/e2e/1. Folder1'
But how can i run i it with multiple folders? Example: Run both 1. Folder1 and 2. Folder2 only

You can send a comma-delineated list to send multiple spec files.
npx cypress run --browser chrome --spec "cypress/e2e/1. Folder1,cypress/e2e/2. Folder2"

Related

Parallel uploads to the same s3 bucket directory with s3cmd

I try to run the following code but index.js turns out to be corrupted.
Any idea why?
gzip dist/production/index.js
mv dist/production/index.js.gz dist/production/index.js
s3cmd --access_key="$S3_ACCESS_KEY" --secret_key="$S3_SECRET_KEY" \
--acl-public --no-mime-magic --progress --recursive \
--exclude "dist/production/index.js" \
put dist/production/
"s3://${BUCKET}/something/${BUILD_IDENTIFIER}/production/" &
s3cmd --access_key="$S3_ACCESS_KEY" --secret_key="$S3_SECRET_KEY" \
--acl-public --no-mime-magic --progress --recursive \
--add-header="Content-Encoding:gzip" \
put dist/production/index.js
"s3://${BUCKET}/something/${BUILD_IDENTIFIER}/production/" &
wait
Notice the & in the end of the two commands that makes two uploads to the same location in parallel.
Edit:
It works fine without parallalizing the process and making them running in the background. I wanted to make the process faster so i upload the heavy gzipped index.js while the other files are uploaded.
Edit2:
What I get in the index.js that is uploaded is gibberish content like this:
��;mS�H���W �7�i"���k��8̪
Edit3:
Looks like the problem was with how I used exclude. It excludes relatively to the uploaded folder and not to the working directory.
--exclude "dist/production/index.js" ==> --exclude index.js
fixed it.
Is your problem is not with the line?
cp dist/production/index.js.gz dist/production/index.js
You are copying gzipped file, not the plain index.js text file.
Hope it helps.
EDIT1:
If you are doing it on purpose why not maintain the gz extension. Extensions does lot of things when you handle with browser.
cp dist/production/index.js.gz dist/production/index.js.gz
If you use plain s3 to download and verify the hash, they should be the same file. I did verify it.

IBM Integration bus mqsicreatebar with references

I'm bit confused with using mqsicreatebar in my environment. I have, for example, following file structure:
root
|--Libraries
| \--Library1
\--Apps
\--App1
\--.project
And App1 is referencing Library1.
I want to run mqsicreatebar such that it will contain App1 with included Library1. I try to run next command in root/Apps folder:
mqsicreatebar -data ./ -b newbarfile.bar -cleanBuild -deployAsSource -a App1 -trace
I get error "Referenced project Library1 is not found on file system". What should I do to create BAR with this file structure?
That "data" parameter tells the mqsicreatebar command where to find an eclipse workspace (Integration Toolkit workspace) that in turn tells the mqsicreatebar command where the project files and other files it needs for the build are.
If you don't have a workspace there already, the command will create one on the fly for you, but only for the current directory and its subdirectories. I do not know how deep this goes. I know it looks at least one subdirectory down for project files (though your comments imply it does not look down two subdirectories).
Alternatively, (and I understand this is not desired, but it's an option, similar to the one you already posted) you could give up on your folder organization and put your library and app subfolders in the same root folder. So you have:
root
|--Library_1
|--Library_2
|--App_1
|--App_2
This is what I have set up in my Bamboo project and the build commands work (even with no workspace files before running the command, as long as I point the data parameter at this root directory).
The only way I've found by myself is copying necessary artifacts to current directory before running mqsicreatebar and deleting them after build completion:
cd /root/Apps/
cp -R ../Libraries/Library1/ ./
mqsicreatebar -data ./ -b newbarfile.bar -cleanBuild -deployAsSource -a App1 -trace
rm -r Library1/

How can the same move command behave differently depending on the context?

This should be trivial really, I have a script that compile an app then bundle it into a dmg.
The steps are:
make
mv app.app/ installer/artifacts/
createDMG
The problem is this runs within a CI system and it fail because it can't find the app.app in the artifacts folder. Indeed if I look at what's inside this folder I can only see a Content folder which is supposed to be app.app's child folder. Now I don't think that the command to move the app.pp folder is wrong because when I run all those 3 steps it works just fine...
I'm a bit confused now, how can 2 move command can have 2 different behaviors ?
If the folder installer/artifacts/ does not exist, move will rename app.app/ to installer/artifacts/
You could do the following instead:
make
mkdir -p installer/artifacts/
mv app.app installer/artifacts/
createDMG

Bash Tab Completion Suggests Hidden SVN Files

When using tab completion, I keep getting suggestions for .svn files, so, using ls, my output looks like this:
[spaceplace]$ ls src/
main/ .svn/
[spaceplace]$ ls src/
main/ .svn/
[spaceplace]$ ls src/
main/ .svn/
[spaceplace]$ ls src/main/
java/ resources/ .svn/
[spaceplace]$ ls src/main/
java/ resources/ .svn/
The .svn files don't show up when I just use ls, so I don't know why they show up when I use tab complete. The issue only seems to exist with the .svn files and no other hidden files, which seems weird. How can I get these files to not show up when I am using tab complete?
I found out a way to do it; in my .bashrc I added the line bind 'set match-hidden-files off'. Now all the files beginning with "." don't show up unless you explicitly specify it.
Bash allows to specify which files or directories to ignore in tab completion based on extensions, e.g. to ignore all files or directories named *.svn
$ export FIGNORE=$FIGNORE:.svn
Depending on how your files are usually named this shouldn't clash too much (at least it worked well for me).
The tab completion does not exclude hidden files. It is acting as intended. If you do a ls -a it will show the hidden files.
It is worth noting that any files/folders that start with a . are hidden files. Command line assumes that you will need access to these files which is why it is suggesting them in the auto complete.

minify phonegap javascript in xcode

How can I run a minification script on the javascript used in a phonegap project after it has been copied into the build by the "copy bundle resources" build phase?
I'm sure it should be a case of adding a script like:
for i in $DSTROOT/www/*.js
do
uglifyjs --overwrite $i
done
But $DSTROOT/www doesn't seem to be the folder it copies things too. What is the correct environment variable to use?
$PROJECT_DIR will get your output project directory. I combine all my js files in my www output directory first:
perl -pe 1 `find "$PROJECT_DIR/www" -name '*.js'` > "$PROJECT_DIR/www/all.js"
You can then minify your combined js in a single command with your chosen minifier.

Resources