Robot Framework - Pabot - Rebot Merge Error : [ ERROR ] Reading XML source '/reports/outputxunit1.xml' failed: - merge

I need help to solve this rebot merge error :
Here is my code :
pabot --testlevelsplit --pabotlib --exclude not_ready --include mytest -x outputxunit1.xml --output original.xml --outputdir reports/ --reporttitle APITests /bin/e2etest ||
pabot --testlevelsplit --pabotlib --exclude not_ready --include mytest -x outputxunit2.xml --rerunfailed /reports/original.xml --output rerun.xml --outputdir reports/ --reporttitle APITests /bin/e2etest ||
rebot --outputdir /reports -R --xunit outputxunit.xml /reports/outputxunit1.xml /reports/outputxunit2.xml
Pabot tests run fine. But in the end I get the following error :
[ ERROR ] Reading XML source '/reports/outputxunit1.xml' failed: Incompatible root element 'testsuite'.
How to merge the outputxunit files without any errors?

You cannot merge xunit xml with rebot. To accomplish what you are trying to do, you have to first merge original output.xm files and than use rebot to create xunit from the merged output. The commands can possibly be in one line, but the input for robot should be original xml.
rebot -o merged.xml --merge original.xml rerun.xml
rebot -x mergedxunit.xml merged.xml

Related

Elastic Beanstalk failed to unzip source file with UTF-8 file name

I was trying to deploy a NextJS application to Elastic Beanstalk via eb deploy. But the source bundle failed to unzip during deployment as the source bundle contained some pre-built .next page which the file name is in UTF-8 encoding. The error is stated as below.
2022/xx/xx xx:xx:xx.xxxxxx [INFO] Executing instruction: StageApplication
2022/xx/xx xx:xx:xx.xxxxxx [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/
2022/01/31 04:56:44.300483 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/
2022/01/31 04:56:45.932820 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: Command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/ failed with error exit status 50. Stderr:error: cannot create /var/app/staging/.next/server/pages/\u6e2c\u8a66/\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66.html
File name too long
error: cannot create /var/app/staging/.next/server/pages/\u6e2c\u8a66/\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66\u6e2c\u8a66.json
File name too long
I was able to unzip the file with option -O UTF-8, is there any way I could add this flag to the eb deploy unzip process?
edit 1. I am working with the Platform 64bit Amazon Linux 2/5.4.9
Not sure if it is good practice, but I eventually added an ebextensions to overcome the original unzipping flow.
commands:
command backup original zip:
command: |
logger "backup zip" && cp /opt/elasticbeanstalk/deployment/app_source_bundle /tmp/app_source_bundle_bak &&
logger "rm existing zip .next folder" && zip -Ad /opt/elasticbeanstalk/deployment/app_source_bundle ".next/*"
cwd: /home/ec2-user
ignoreErrors: false
container_commands:
replace the original zip to staging:
command: |
logger "custom unzip" &&
unzip -O UTF-8 -q -o /tmp/app_source_bundle_bak -d /var/app/staging/
cwd: /home/ec2-user
ignoreErrors: false

Github actions/cache#v2: unrecognized option: posix in the post job

I'm using Github Actions to implement a CI pipeline in my project. Currently, I'm trying to use actions/cache#v2 to cache yarn cache dir to improve the pipeline time. Unfortunately, always that the actions/cache#v2 runs I'm getting an error in the post-job saying: /bin/tar: unrecognized option: posix. The complete log is:
Post job cleanup.
/usr/bin/docker exec 4decc52e7744d9ab2e81bb24c99a830acc848912515ef1e86fbb9b8d5049c9cf sh -c "cat /etc/*release | grep ^ID"
/bin/tar --posix -z -cf cache.tgz -P -C /__w/open-tuna-api/open-tuna-api --files-from manifest.txt
/bin/tar: unrecognized option: posix
BusyBox v1.31.1 () multi-call binary.
Usage: tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]...
Create, extract, or list files from a tar file
c Create
x Extract
t List
-f FILE Name of TARFILE ('-' for stdin/out)
-C DIR Change to DIR before operation
-v Verbose
-O Extract to stdout
-m Don't restore mtime
-o Don't restore user:group
-k Don't replace existing files
-Z (De)compress using compress
-z (De)compress using gzip
-J (De)compress using xz
-j (De)compress using bzip2
-a (De)compress using lzma
-h Follow symlinks
-T FILE File with names to include
-X FILE File with glob patterns to exclude
--exclude PATTERN Glob pattern to exclude
Warning: Tar failed with error: The process '/bin/tar' failed with exit code 1
I'm following the example of the official action cache repository. Here a snippet of my CI.yml
# Configure cache
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache#v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
Because of the above error, the cache is not created and the pipeline time is not improved. I've tried changing the hasFiles expression and the entire key, but no success.
My question is: Am I making some mistake in the use of Action Cache? Can anyone help me with this issue? Thanks.
Your problem is that you're running inside an Alpine Linux-based container. Alpine Linux is designed for small size, and as a result it replaces many of the standard GNU utilities with those from busybox, a multi-call binary. Your version of tar is one of those.
The actions/cache#v2 action uses tar --posix, which tells tar to create a standard pax-format archive. pax archives are a form of tar archive that can handle arbitrarily long filenames, huge file sizes, and other types of metadata that tar archives cannot. This format is specified by POSIX and is a better choice than GNU tar-style archives because it works across a variety of systems and isn't specified by what one implementation does, in addition to being more featureful.
However, the version of tar shipped as part of busybox doesn't support the --posix option, and as a result this command fails. If you want to use the actions/cache#v2 GitHub Action, then you need to provide a version of GNU or BSD (libarchive) tar earlier in your PATH before running it so that that command can be used instead of busybox's.

Error in run script phase: framework is a directory

I'm using the apollo framework for GraphQL that I installed using Carthage but I have an error when I run the script to generate the API.swift file during the build phase.
The error is
> [myproject]/Carthage/Build/iOS/Apollo.framework: is a directory
Command /bin/sh failed with exit code 126
I did added the script like in the apollo doc :
Here is the script itself:
APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1)"
if [ -z "$APOLLO_FRAMEWORK_PATH" ]; then
echo "error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project."
exit 1
fi
cd "${SRCROOT}/${TARGET_NAME}"
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output API.swift
Of course, I have also generated the schema.json beforehand
Might be a bit late to answer but at least on my machine APOLLO_FRAMEWORK_PATH gets evaluated to two frameworks (iOS and watchOS) and thus running the bundled script with $APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh fails.
Assuming the scripts don't differ (as of version apollo-ios#0.8.0 they don't) you can add -print -quit to the end of the find command to make it return only one result.
The full script will be:
APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1 -print -quit)"
if [ -z "$APOLLO_FRAMEWORK_PATH" ]; then
echo "error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project."
exit 1
fi
cd "${SRCROOT}/${TARGET_NAME}"
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output API.swift

Go language: can't find import (github project)

Hi I am writing on a small go app solving a specified graph problem. I want to use goraph's maxflow algorithm (see github.com/gyuho/goraph) for this, but I have problems to import it to my project.
What I have done:
- I created a .go folter in my home directory and added the GOPATH to my .bash_profile (export GOPATH=$HOME/.go)
Then I called "go get github.com/gyuho/goraph". The files are stored under ~/.go/src/github.com/gyuho/goraph. In .go also exist a "bin" and a "pkg" folder.
In my code I do the following:
package flow
import (
"encoding/json"
"github.com/gyuho/goraph"
"log"
)
//some func definitions...
This is my Makefile:
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOFMT=gofmt -w
# Directories
SRC=src
FLOW_SRC=$(SRC)/flow
ERLANGC_SRC=$(SRC)/erlangc
LOGGING_SRC=$(SRC)/logging
# Names and files
MAKING_OS=$(shell go env GOOS)
MAKING_ARCH=$(shell go env GOARCH)
TARGET_NAME=flow
TARGET_DIR=$(shell pwd)/bin
# Cross compilation targets
BIN_DARWIN_AMD64=darwin-amd64
BIN_LINUX_AMD64=linux-amd64
BIN_LINUX_386=linux-386
TARGET_LINUX_AMD64=$(TARGET_DIR)/$(BIN_LINUX_AMD64)/$(TARGET_NAME)
TARGET_LINUX_386=$(TARGET_DIR)/$(BIN_LINUX_386)/$(TARGET_NAME)
TARGET_DARWIN_AMD64=$(TARGET_DIR)/$(BIN_DARWIN_AMD64)/$(TARGET_NAME)
ALL_TARGETS=$(TARGET_LINUX_AMD64) $(TARGET_LINUX_386) $(TARGET_DARWIN_AMD64)
# Rules
all: format tests build-darwin-amd64 build-linux-amd64 build-linux-386
clean: $(ALL_TARGETS)
$(GOCLEAN)
rm -f $^
ci: tests build-linux-amd64
tests:
$(GOTEST) $(FLOW_SRC)/*.go
$(GOTEST) $(ERLANGC_SRC)/*.go
build-darwin-amd64:
mkdir -p $(TARGET_DIR)/$(BIN_DARWIN_AMD64)
cd src && GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(TARGET_DARWIN_AMD64)
build-linux-amd64:
mkdir -p $(TARGET_DIR)/$(BIN_LINUX_AMD64)
cd src && GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(TARGET_LINUX_AMD64)
build-linux-386:
mkdir -p $(TARGET_DIR)/$(BIN_LINUX_386)
cd src && GOARCH=386 GOOS=linux $(GOBUILD) -o $(TARGET_LINUX_386)
format:
$(GOFMT) -d -tabwidth=2 -tabs=false -w -s $(FLOW_SRC)/*.go
$(GOFMT) -d -tabwidth=2 -tabs=false -w -s $(ERLANGC_SRC)/*.go
go env:
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/bstoecker/.go/"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.2.2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.2.2/libexec/pkg/tool/darwin_amd64"
TERM="dumb"
CC="clang"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common"
CXX="clang++"
CGO_ENABLED="1"
when calling make I get the following error:
gofmt -w -d -tabwidth=2 -tabs=false -w -s src/flow/*.go
gofmt -w -d -tabwidth=2 -tabs=false -w -s src/erlangc/*.go
go test src/flow/*.go
# command-line-arguments
src/flow/graph_json.go:5: can't find import: "github.com/gyuho/goraph"
FAIL command-line-arguments [build failed]
make: *** [tests] Error 2
anyone an idea what I am doing wrong?
thanks so far
Any example in that goraph project don't import just "github.com/gyuho/goraph".
They import a specific package within that application:
For instance:
import (
"fmt"
"testing"
"github.com/gyuho/goraph/algorithm/bfs"
"github.com/gyuho/goraph/graph/gsd"
// go test -v github.com/gyuho/goraph/example
// go test -v /Users/gyuho/go/src/github.com/gyuho/goraph/example/bfs_test.go
)
See if you can import one of those packages within goraph, instead of goraph itself.

aapt can't find 9Patch Images

I want to certificate an Android project just with cmd. Now Im stocked at the creation of the .apk file. aapt says he cant find the pictures with the .9. ending. If i rename this pictures and delete the .9. ending then everything works fine without the correct size of the pictures in the app.
ettings
I figured out that I have to "crunch" this pictures, like what he says at the page: Ant Build AAPT Crunch is stripping draw9 information from Library resource images but Im not sure how this works correctly.
I tried this command:
aapt crunch -v -S res -C bin/res
It works with my .9.png files but I still dont get it how I can run it, that it creates the .apk file. How can I use it in the following command ?
aapt package -v -f -A \assets -M \AndroidManifest -S \res -I \android.jar -F \Projectname.unsigned.apk \bin
Just this command gives me the following error:
activity_settings.xml:2: error: Error: No resource found that matches the given name (at 'sound' with value '#drawable/btn_sound_active_pressed')
This file is an .9.png file.
With eclipse everything runs fine.
So i figured it out: I have to "crunch" all picture in the res folder first:
aapt crunch -v -S \res -C \bin\res
And then I pointed as a source folder to the res dir and to the bin\res dir. Also added --no-chrunch --generate-dependencies
aapt package --no-crunch --generate-dependencies -v -f
-M \AndroidManifest.xml"
-S \bin\res
-S \res
-A \assets
-I \android.jar
-F \bin\APPNAME.unsigned.apk \bin
Now Its working perfectly. Also with the .9.png 9patch pictures.