Specrun Command Line Filter by name of feature - specrun

How to run Specrun using a filter of feature's name
Fragment of Default.srprofile:
<TestAssemblyPaths>
<TestAssemblyPath>smth.dll</TestAssemblyPath>
</TestAssemblyPaths>
<Filter></Filter>
<DeploymentTransformation>
Cmd:
SpecRun.exe run Default.srprofile /filter:"features:Feature:FeatureName"
Here example from github:
Scenario: Should be able to filter for feature
Given the filter is configured to 'testpath:Feature:Feature_1'
When I execute the tests
Then the execution summary should contain
| Total |
| 3 |
https://github.com/mikeborozdin/BDD-with-SpecFlow-and-White/blob/master/packages/SpecRun.0.13.0.72/docs/Filtering/03_TestPathFiltering.feature

Related

How to list all parameters in Postgres?

I was wondering if there's a parameter for the currently authenticated psql user?
But then I wonder a more broader question - how can I just see what all the paremeters are?
I might discover some interesting parameters if I could see a whole list of them?
I'm only seeing online how to get the value of one parameter. Not a list...
Alvaro has answered the question how to list your current parameter values.
To get the authenticated user, you can call the SQL function session_user:
SELECT session_user;
The currently effective user can be seen with
SELECT current_user;
In psql, you can see details about your current database session with
\conninfo
Nonsense. Try these two SQL statements:
set foo.bar =42;
and then:
select current_setting('foo.bar');
You’ve just set, and read an entity that the PostgreSQL doc doesn’t seem to name. You might call x.y a “user-defined session parameter”. Where is its value held? Server-side, of course.
I too would like to know how to list the names of all currently defined such entities—system-defined, like TimeZone, and user-defined.
— bryn#yugabyte.com
PostgreSQL does not have such a thing as server-side session variables, so it's not clear what you are asking about.
Some PLs (such as PL/Python, PL/Perl) have session variables (%_SHARED in PL/Perl, GD and SD in PL/Python for example), but they are internal to the PL, not part of the server proper.
psql also has variables, which you can set with \set, and you can get a list with the same command. I suppose that's not what you want though.
Maybe you refer to so-called custom GUC configuration parameters, which are sometimes abused as session variables. You can get a list of those using SHOW ALL or SELECT * FROM pg_catalog.pg_settings.
SHOW ALL below can show all parameters according to the documentation:
SHOW ALL;
This is how SHOW ALL works below:
postgres=# SHOW ALL;
name | setting | description
----------------------------+-------------+------------------------------------------------------------------------------------------
allow_in_place_tablespaces | off | Allows tablespaces directly inside pg_tblspc, for testing.
allow_system_table_mods | off | Allows modifications of the structure of system tables.
application_name | psql | Sets the application name to be reported in statistics and logs.
archive_cleanup_command | | Sets the shell command that will be executed at every restart point.
archive_command | (disabled) | Sets the shell command that will be called to archive a WAL file.
archive_mode | off | Allows archiving of WAL files using archive_command.
archive_timeout | 0 | Forces a switch to the next WAL file if a new file has not been started within N seconds.
array_nulls | on | Enable input of NULL elements in arrays.
authentication_timeout | 1min | Sets the maximum allowed time to complete client authentication.
autovacuum | on | Starts the autovacuum subprocess.
...
And, you can show one specific parameter with SHOW as shown below:
postgres=# SHOW allow_in_place_tablespaces;
allow_in_place_tablespaces
----------------------------
off
(1 row)
But, you cannot show more than one parameters with SHOW as shown below:
postgres=# SHOW allow_in_place_tablespaces, allow_system_table_mods;
ERROR: syntax error at or near ","
LINE 1: show allow_in_place_tablespaces, allow_system_table_mods;
So to show more than one parameters, use SELECT FROM pg_settings below:
postgres=# SELECT name, setting, short_desc FROM pg_settings WHERE name IN ('allow_in_place_tablespaces', 'allow_system_table_mods');
name | setting | short_desc
----------------------------+---------+------------------------------------------------------------
allow_in_place_tablespaces | off | Allows tablespaces directly inside pg_tblspc, for testing.
allow_system_table_mods | off | Allows modifications of the structure of system tables.
(2 rows)
In addition, current_setting() can show one specific parameter as shown below:
postgres=# SELECT current_setting('allow_in_place_tablespaces');
current_setting
-----------------
off
(1 row)
But, you cannot show more than one parameters with current_setting() as shown below:
postgres=# SELECT current_setting('allow_in_place_tablespaces', 'allow_system_table_mods');
ERROR: invalid input syntax for type boolean: "allow_system_table_mods"
LINE 1: ...ECT current_setting('allow_in_place_tablespaces', 'allow_sys...

Behat test don't send the same information on database with a json array

In my features when i execute my behat test i send it like this :
And the following user:
| id | array |
| ID1 | [{"key1":"value1","key2":"value2"}] |
But in my database i receive this information
| id | array (DC2Type:json_array) |
| ID1 | ["[{\"key1\":\"value1\"","\"key2\":\"value2\"}]"] |
So i can't use this informations on my array.
Have you got any idea which expression i have to use for have the same informations like tests entries?
I precise i work with symfony 3.4.15, API Platform and PhpMyAdmin
Thank you!
Feature files are flexible, but we should avoid adding to much details.
I would hide all unnecessary info from the scenario that doesn't bring any value.
You could hide this information in the feature file and create a method that sets some user details based on some key/parameter identifier.
/**
* #Then /^I have an (.*) user$/
*/
public function iHaveAUser($user) {
// generates/gets some data in any format you need
$dataINeed = generateUser($user);
}

Is there a delay between a SET and a GET with the same key in Redis?

I have three processes on one computer:
A test (T)
A nginx server with my own module (M) --- the test starts and stops this process between each test case section
A Redis server (R), which is always running --- the test does not handle the start/stop sequence of this service (I'm testing my nginx module, not Redis.)
Here is a diagram of the various events:
T M R
| | |
O-------->+ FLUSHDB
| | |
+<--------O (FLUSHDB acknowledge as successful)
| | |
O-------->+ SET key value
| | |
+<--------O (SET acknowledge as successful)
| | |
O--->+ | Start nginx including my module
| | |
| O--->+ GET key
| | |
| +<---O (SUCCESS 80% and FAILURE 20%)
| | |
The test clears the Redis database with FLUSHDB then adds a key with SET key value. The test then starts nginx including my module. There, once in a while, the nginx module GET key action fails.
Note 1: I am not using the ASync implementation of Redis.
Note 2: I am using the C library hiredis.
Is it possible that there would be a delay between a SET and a following GET with the same key which would explain that this process would fail once in a while? Is there a way for me to ensure that the SET is really done once the redisCommand() function returns?
IMPORTANT NOTE: if I run one such test and the GET fails in my nginx module, the key appears in my Redis:
redis-cli
127.0.0.1:6379> KEYS *
1) "8b95d48d13e379f1ccbcdfc39fee4acc5523a"
127.0.0.1:6379> GET "8b95d48d13e379f1ccbcdfc39fee4acc5523a"
"the expected value"
So the
SET "8b95d48d13e379f1ccbcdfc39fee4acc5523a" "the expected value"
worked as expected. Only the GET failed and I would assume that it is because it somehow occurred too quickly. Any idea how to tackle this problem?
No, there is no delay between set and get. What you are doing should work.
Try running the monitor command in a separate window. When it fails - does the set command come before/after the get command?

Watson Discovery Service Issue

Right Way - It's working
Wrong Way - Isn't working how should be
I'd like your help about an issue. I'm using wds and so I created a collection that was uploaded by several pieces of a manual. Once I did it, on the conversation service I also created, I put some descriptions on the intentions that the Discovery should uses. Now, when I try to identify these descriptions on the Discovery Service, unless I write exactly the same to test, it's not recognizing. Any suggestion about what can I use to fix it?
e.g. I uploaded a metadata txt file with the following fields:
+---------------------+------------+-------------+-----------------------+---------+------+
| Document | DocumentID | Chapter | Session | Title | Page |
+---------------------+------------+-------------+-----------------------+---------+------+
| Instructions Manual | BR_1 | Maintenance | Long Period of Disuse | Chassis | 237 |
+---------------------+------------+-------------+-----------------------+---------+------+
Now, when I search on the Discovery, I need to use the exactly word I put on the intention's description (Chassis). Otherwise the Discovery it's not getting through the way below:
metadata.Title:chas*|metadata.Chapter:chas*|metadata.Session:chas*
Any idea??
Please check the syntax if its right or wrong by matching it with discovery tool.
Sometimes we need inverted commas with backslash.

gSheets horizontal with ARRAYFORMULA(SPLIT(...))

I'm creating a dashboard in gSheets to report key metrics for A/B tests on my company's billing page. The data auto-pulls from GA via gSheets' addon, and I've decided to dynamically populate the list of tests on the dashboard by using the UNIQUE(...) function. This, in turn, allows metrics matching each test (by name) to pull into the dashboard from the data dump.
Case: Because it's a dynamic list of tests that will change over time (there are currently 4, there may be 3 next time, or 7, who knows), I've decided to set up the names horizontally with the metrics vertical, like so:
New Users
| Test A | Test B | Test C | Test D |
----------------|--------|--------|--------|--------|
Sessions |
Conversions |
Conversion Rate |
Return Users
| Test A | Test B | Test C | Test D |
----------------|--------|--------|--------|--------|
Sessions |
Conversions |
Conversion Rate |
The example above is how I'd like it to look. In reality, the test names are extremely long due to identifying keywords, which help in GA but make it impossible to tell which is which in the spreadsheet dashboard. The test name is at the end.
Here's what I'm working with:
Optimizely_AB_Test_Alternate_Billing_(Prod)(Property) (AccountNum): devicesImage
I want to split names on " ", preferably with an arrayformula so it populates horizontally for however many columns have a test. Then I can hide the row with the full name (allowing it to still be used for reference), while displaying the shorter name so people can tell what the test is.
Problem: I'm stuck trying to make the arrayformula go horizontally,
Current approach: =ARRAYFORMULA(TRANSPOSE(SPLIT(A13:13," ")))
Current approach output:
| coversImage | blank | blank | blank
----------------|-------------|-------|-------|-------|
Sessions |
Conversions |
Conversion Rate |
Desired output:
| coversImage | devicesImage | lifestyleImage | stringCentered |
----------------|-------------|--------------|----------------|----------------|
Sessions |
Conversions |
Conversion Rate |
I have to assume your test names are initially this:
Optimizely_AB_Test_Alternate_Billing_(Prod)(Property) (AccountNum):
devicesImage Optimizely_AB_Test_Alternate_Billing_(Prod)(Property)
(AccountNum): coversImage
Optimizely_AB_Test_Alternate_Billing_(Prod)(Property) (AccountNum):
lifestyleImage Optimizely_AB_Test_Alternate_Billing_(Prod)(Property)
(AccountNum): stringCentered
In that case we can extract with regular expressions everything atfer ": ":
=ArrayFormula(TRANSPOSE(REGEXEXTRACT(E26:E29, "(?:\: )(\w*)$")))

Resources